-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.worker.js
More file actions
46 lines (43 loc) · 1.06 KB
/
webpack.worker.js
File metadata and controls
46 lines (43 loc) · 1.06 KB
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
const webpack = require('webpack')
const path = require('path')
const { merge } = require('webpack-merge')
const common = require('./webpack.common')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const config = merge(common, {
target: 'webworker',
entry: './src/entry-worker.js',
mode: 'production',
output: {
path: path.resolve(__dirname, 'workers-site/worker'),
filename: 'worker.js',
},
resolve: {
alias: {
fs: path.resolve(__dirname, 'empty.js'),
module: path.resolve(__dirname, 'empty.js'),
}
},
optimization: {
runtimeChunk: false,
splitChunks: false,
minimize: false,
},
performance: {
hints: false,
},
plugins: [
new webpack.DefinePlugin({
// 'process.env.VUE_ENV': JSON.stringify('server'),
'process.env.NODE_ENV': JSON.stringify('production'),
}),
new webpack.optimize.LimitChunkCountPlugin({
maxChunks: 1
})
],
module: {
}
})
config.plugins = config.plugins.filter((plugin) => {
return !(plugin instanceof HtmlWebpackPlugin)
})
module.exports = config