graphql-loader
graphql-loader copied to clipboard
Multiple destination files
Hi,
Hi have an issue with the way graphql files are imported.
Let's assume you have a project with two or more destination files, let's say : front.js admin.js
entry : {
front : `./src/front.js`,
admin : `./src/admin.js`,
},
output : {
path : path.join(__dirname, `static/assets/`),
filename : `[name].js`,
publicPath : `/assets/`,
},
module : {
rules : [
{
test : /\.graphql?$/,
loader : `webpack-graphql-loader`,
options: {
output : 'string',
minify : true,
},
},
]
}
If I require a graphql file in admin, it will also be imported in front.js. In fact all .graphql files will be imported in all my dest files. I don't know how to prevent this behavior ?