-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.js
37 lines (36 loc) · 954 Bytes
/
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
const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
module.exports = () => {
return {
devtool: 'inline-source-map',
entry: {
'dist/js/index': './src/js/index.js',
'dist/js/index.min': './src/js/index.js',
'dist/js/index.mapbox': './src/js/index.mapbox.js',
'dist/js/index.mapbox.min': './src/js/index.mapbox.js'
},
output: {
path: path.join(__dirname, ''),
filename: '[name].js'
},
plugins: [
new CopyWebpackPlugin([
{ from: 'src/css', to: 'dist/css' },
{ from: 'vendor', to: 'dist/vendor' }
]),
// new UglifyJsPlugin({
// include: /\.min\.js$/
// })
],
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /(node_modules|bower_components|vendor)/
}
]
}
};
};