-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.main.config.js
54 lines (51 loc) · 1.26 KB
/
webpack.main.config.js
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
const SpeedMeasurePlugin = require("speed-measure-webpack-plugin");
const { merge } = require("webpack-merge");
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
const path = require("path");
const smp = new SpeedMeasurePlugin({
granularLoaderData: true,
outputFormat: "humanVerbose",
disabled: true,
});
const config = merge(
{
/**
* This is the main entry point for your application, it's the first file
* that runs in the main process.
*/
entry: "./src/index.ts",
// Put your normal webpack config below here
module: {
rules: require("./webpack.rules"),
},
experiments: {
topLevelAwait: true,
},
ignoreWarnings: [
{
module: /node_modules\/ws/,
message: /Can't resolve/,
},
],
output: {
publicPath: ".webpack/main/",
},
plugins: [
new ForkTsCheckerWebpackPlugin({
typescript: {
extensions: {
vue: false,
},
mode: "write-tsbuildinfo",
configFile: path.resolve(__dirname, "src", "tsconfig.json"),
},
devServer: false,
}),
],
},
require("./webpack.common.config"),
);
module.exports = (_, { mode }) => {
global.mode = mode;
return config;
};