Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can i use the plugin with webpack-chain #27

Closed
fxylee opened this issue Feb 20, 2019 · 1 comment
Closed

How can i use the plugin with webpack-chain #27

fxylee opened this issue Feb 20, 2019 · 1 comment
Labels

Comments

@fxylee
Copy link

fxylee commented Feb 20, 2019

First: I have no problem using it through webpack.config.js.
But I can't get compiled results when i use chainWebpack to config webpack,
So I'm not sure my configuration code is correct.

config.module
  .rule('graphql')
     .test(/\.graphql$/)
  .include
    .add(path.resolve(__dirname, 'src'))
    .end()
  .exclude
    add(/node_modules/)
    .end()
  .use('graphql-tag/loader')
    .loader('graphql-tag/loader')
    .end();
# demo.graphql
query Demo {
  uv
}

I got a Base64 string when I imported it

import DemoGQL from './demo.graphql'
@fxylee
Copy link
Author

fxylee commented Feb 21, 2019

This problem has been solved. Is a configuration problem for umijs;
Reference answer

@fxylee fxylee closed this as completed Feb 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants