@@ 1-55 (lines=55) @@ | ||
1 | import webpack from "webpack"; |
|
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 | { |
|
36 | from: path.resolve( |
|
37 | __dirname, |
|
38 | "node_modules/graphql-voyager/dist/voyager.worker.js" |
|
39 | ), |
|
40 | }, |
|
41 | { |
|
42 | from: path.resolve( |
|
43 | __dirname, |
|
44 | "node_modules/graphql-voyager/dist/voyager.css" |
|
45 | ), |
|
46 | }, |
|
47 | { from: path.resolve(__dirname, "src/container.css") }, |
|
48 | ], |
|
49 | }), |
|
50 | ], |
|
51 | externals: { |
|
52 | jquery: "jQuery", |
|
53 | drupal: "Drupal", |
|
54 | }, |
|
55 | }; |
|
56 |
@@ 1-44 (lines=44) @@ | ||
1 | import webpack from "webpack"; |
|
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 |