1 | View Code Duplication | import webpack from "webpack"; |
|
0 ignored issues
–
show
Duplication
introduced
by
![]() |
|||
2 | import path from "path"; |
||
3 | import CopyWebpackPlugin from "copy-webpack-plugin"; |
||
4 | |||
5 | module.exports = { |
||
6 | context: path.resolve(__dirname, "src"), |
||
7 | entry: "./index.js", |
||
8 | output: { |
||
9 | path: path.resolve(__dirname, "dist"), |
||
10 | filename: "bundle.min.js", |
||
11 | }, |
||
12 | resolve: { |
||
13 | extensions: [".mjs", ".jsx", ".js", ".json"], |
||
14 | modules: [path.resolve(__dirname, "node_modules"), "node_modules"], |
||
15 | }, |
||
16 | mode: "production", |
||
17 | module: { |
||
18 | rules: [ |
||
19 | { |
||
20 | test: /\.jsx?$/, |
||
21 | exclude: /node_modules/, |
||
22 | use: "babel-loader", |
||
23 | }, |
||
24 | ], |
||
25 | }, |
||
26 | optimization: { |
||
27 | minimize: true, |
||
28 | }, |
||
29 | plugins: [ |
||
30 | new webpack.DefinePlugin({ |
||
31 | "process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV), |
||
32 | }), |
||
33 | new CopyWebpackPlugin({ |
||
34 | patterns: [ |
||
35 | { from: path.resolve(__dirname, "node_modules/graphiql/graphiql.css") }, |
||
36 | { from: path.resolve(__dirname, "src/container.css") }, |
||
37 | ], |
||
38 | }), |
||
39 | ], |
||
40 | externals: { |
||
41 | jquery: "jQuery", |
||
42 | drupal: "Drupal", |
||
43 | }, |
||
44 | }; |
||
45 |