-
Notifications
You must be signed in to change notification settings - Fork 4
/
webpack.config.js
65 lines (64 loc) · 1.63 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
const CopyPlugin = require('copy-webpack-plugin');
const LicensePlugin = require('webpack-license-plugin')
const TerserPlugin = require('terser-webpack-plugin');
const path = require('path');
module.exports = {
mode: 'production',
entry: './src/index.js',
optimization: {
minimizer: [new TerserPlugin({
extractComments: false,
})],
},
devServer: {
client: {
overlay: {
errors: true,
warnings: false
}
},
devMiddleware: {
stats: 'minimal'
}
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
},
module: {
rules: [{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
}, ],
},
plugins: [
new CopyPlugin({
patterns: [{
from: './src/index.html',
to: 'index.html'
},
{
from: './src/img',
to: 'img'
}
],
}),
new LicensePlugin({
licenseOverrides: {
// https://github.com/codepunkt/webpack-license-plugin/issues/443
'@mapbox/[email protected]': 'BSD-2-Clause'
},
// mapbox-gl uses a custom license
excludedPackageTest: name => name === 'mapbox-gl',
additionalFiles: {
'oss-licenses.json': packages => JSON.stringify([...packages, {
'name': 'mapbox-gl',
'version': '1.13.1',
'repository': 'https://github.com/mapbox/mapbox-gl-js',
'license': "Mapbox license",
'licenseText': 'content of LICENSE.txt in mapbox-gl-js root directory: https://raw.githubusercontent.com/mapbox/mapbox-gl-js/v1.13.1/LICENSE.txt'
}], null, 2)
}
}),
]
};