forked from tiange997/iStoryline.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
85 lines (82 loc) · 2.08 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
const path = require('path')
const webpack = require('webpack')
const WebpackBar = require('webpackbar')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const HtmlWebpackPluginConfig = new HtmlWebpackPlugin({
template: './app/static/simple11.html',
filename: 'simple11.html',
inject: 'body',
chunks: ['simple11'],
})
module.exports = {
context: path.resolve(__dirname),
devtool: 'source-map',
entry: {
simple11: ['./app/js/simple11.js'],
complex11: ['./app/js/complex11.js'],
complex5: ['./app/js/complex5.js'],
simple5: ['./app/js/simple5.js'],
complex16: ['./app/js/complex16.js'],
simple16: ['./app/js/simple16.js'],
},
output: {
path: path.resolve(__dirname, 'dist'),
// filename: 'index_bundle.js',
filename: '[name].js',
chunkFilename: '[id].[chunkhash].js',
},
devServer: {
publicPath: '/',
contentBase: "./",
hot: true
},
mode: 'production',
module: {
rules: [
{
test: require.resolve('snapsvg'),
use: 'imports-loader?this=>window,fix=>module.exports=0',
},
],
},
performance: {
hints: false,
maxEntrypointSize: 512000,
maxAssetSize: 512000,
},
stats: { children: false },
plugins: [
HtmlWebpackPluginConfig,
new HtmlWebpackPlugin({
template: './app/static/complex11.html',
filename: 'complex11.html',
inject: 'body',
chunks: ['complex11'],
}),
new HtmlWebpackPlugin({
template: './app/static/simple5.html',
filename: 'simple5.html',
inject: 'body',
chunks: ['simple5'],
}),
new HtmlWebpackPlugin({
template: './app/static/complex5.html',
filename: 'complex5.html',
inject: 'body',
chunks: ['complex5'],
}),
new HtmlWebpackPlugin({
template: './app/static/complex16.html',
filename: 'complex16.html',
inject: 'body',
chunks: ['complex16'],
}),
new HtmlWebpackPlugin({
template: './app/static/simple16.html',
filename: 'simple16.html',
inject: 'body',
chunks: ['simple16'],
}),
new WebpackBar(),
],
}