-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathwebpack.config.js
More file actions
33 lines (32 loc) · 888 Bytes
/
webpack.config.js
File metadata and controls
33 lines (32 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const path = require("path");
const fs = require("fs");
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
module.exports = (env) => {
if (env.m == 1) {
return {
mode: "production", // "production" | "development" | "none"
entry: {
global: "./lib/esnext/bundleGlobal.js",
},
output: {
path: path.resolve(__dirname, "lib/bundle"),
filename: "[name].js",
},
plugins: [new NodePolyfillPlugin()],
};
} else {
return {
mode: "production", // "production" | "development" | "none"
entry: {
module: "./lib/esnext/browser.js",
},
output: {
library: { type: "module" },
path: path.resolve(__dirname, "lib/bundle"),
filename: "[name].js",
},
experiments: { outputModule: true },
plugins: [new NodePolyfillPlugin()],
};
}
};