-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
44 lines (43 loc) · 1.41 KB
/
webpack.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
module.exports = function (env /*, argv*/ ) {
var prod = env.production === 1;
return {
mode: prod ? "production" : "development",
devtool: prod ? "none" : "inline-source-map",
entry: {
// Entry point for main code
bundle: "./src/main.ts"
// Entry point for Chip8 worker
//worker: "./src/chip8.ts"
},
output: {
// It will create two bundles (based on entry names): bundle.js and worker.js
filename: "[name].js"
},
resolve: {
// Add `.ts` and `.tsx` as a resolvable extension.
extensions: [".ts", ".tsx", ".js"]
},
module: {
rules: [
// all files with a `.ts` or `.tsx` extension will be handled by `ts-loader`
{
test: /\.(ts|tsx)?$/,
loader: "ts-loader",
exclude: /node_modules/
}/*,
{
test: /\.worker\.ts$/,
loader: "worker-loader",
options: { name: 'worker.js' }
}*/
]
}
/*,
optimization: {
// This avoids having duplicated modules if there are multiple bundles
splitChunks: {
chunks: 'all'
}
}*/
};
};