graphql-loader icon indicating copy to clipboard operation
graphql-loader copied to clipboard

Multiple destination files

Open ValentinCreative opened this issue 5 years ago • 0 comments

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 ?

ValentinCreative avatar Jul 09 '20 14:07 ValentinCreative