-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathwebpack.config.js
57 lines (54 loc) · 1.34 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
var path = require('path');
var CopyWebpackPlugin = require('copy-webpack-plugin');
// Base配置 打包文件配置
var entry = {
example: './example.js',
};
module.exports = {
plugins: [
new CopyWebpackPlugin([
{
from: './node_modules/lodash/lodash.min.js',
to: './lodash.min.js'
},
{
from: './node_modules/d3/build/d3.min.js',
to: './d3.min.js'
},
{
from: './dat.gui.min.js',
to: './dat.gui.min.js'
}
])
],
entry: entry,
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js'
},
// devtool: "source-map",
module: {
//加载器配置
rules: [{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: [
"env",
]
}
}, {
test: /\.scss$/,
loaders: 'style-loader!css-loader!sass-loader',
},
{
test: /\.html$/,
loader: 'html-loader',
}
]
},
resolve: {
modules: ['./src', './node_modules']
},
};