forked from opensheetmusicdisplay/opensheetmusicdisplay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.prod.js
39 lines (38 loc) · 1.09 KB
/
webpack.prod.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
const { merge } = require('webpack-merge');
var webpack = require('webpack')
var path = require('path')
var common = require('./webpack.common.js')
var Visualizer = require('webpack-visualizer-plugin2')
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
module.exports = merge(common, {
output: {
filename: '[name].min.js',
path: path.resolve(__dirname, 'build'),
library: 'opensheetmusicdisplay',
libraryTarget: 'umd'
},
mode: 'production',
optimization: {
minimize: true
// splitChunks: {
// chunks: 'all',
// name: false
// }
},
plugins: [
// build optimization plugins
new CleanWebpackPlugin({
verbose: false,
dry: false,
cleanOnceBeforeBuildPatterns: ['**/*', '!statistics.html*']
}),
new webpack.LoaderOptionsPlugin({
minimize: true,
debug: true
}),
new Visualizer({
path: path.resolve(__dirname, 'build'),
filename: './statistics.html'
})
]
})