-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
59 lines (58 loc) · 1.37 KB
/
webpack.config.js
File metadata and controls
59 lines (58 loc) · 1.37 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
47
48
49
50
51
52
53
54
55
56
57
58
59
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: {
'demo_d3': './src/demo_d3/index.js',
'demo_d2b': './src/demo_d2b/index.js',
'demo_vue_d2b': './src/demo_vue_d2b/index.js',
'index': './src/index/index.js'
},
output: {
path: path.resolve('dist'),
filename: '[name].bundle.js'
},
module: {
rules:[
{
test:/\.(s*)css$/,
use:['style-loader','css-loader', 'sass-loader'],
exclude: /node_modules/
},
{
test:/\.js$/,
use:['babel-loader'],
exclude: /node_modules/
},
{
test: /\.vue$/,
loader: 'vue-loader'
}
]
},
plugins: [
new HtmlWebpackPlugin({
inject: true,
chunks: ['index'],
filename: 'index.html',
template: './src/index/index.html'
}),
new HtmlWebpackPlugin({
inject: true,
chunks: ['index', 'demo_d3'],
filename: 'demo_d3.html',
template: './src/demo_d3/index.html'
}),
new HtmlWebpackPlugin({
inject: true,
chunks: ['index', 'demo_d2b'],
filename: 'demo_d2b.html',
template: './src/demo_d2b/index.html'
}),
new HtmlWebpackPlugin({
inject: true,
chunks: ['index', 'demo_vue_d2b'],
filename: 'demo_vue_d2b.html',
template: './src/demo_vue_d2b/index.html'
})
]
};