-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathwebpack.prod.js
35 lines (34 loc) · 948 Bytes
/
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
const path = require('path')
const webpack = require('webpack')
const merge = require('webpack-merge')
const common = require('./webpack.common.js')
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
// const MiniCssExtractPlugin = require('mini-css-extract-plugin')
module.exports = merge(common, {
mode: 'production',
devtool: 'source-map',
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'index.js',
libraryTarget: 'umd',
library: {
root: 'TinyWheels',
amd: 'tiny-wheels',
commonjs: 'tiny-wheels'
}
},
plugins: [
new CleanWebpackPlugin(),
new UglifyJSPlugin({
sourceMap: true
}),
// new MiniCssExtractPlugin({
// filename: 'tiny-wheels.min.css'
// }),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
})
]
})