UNPKG

777 BJavaScriptView Raw
1const path = require('path');
2const webpack = require('webpack');
3const TaserJSPlugin = require('terser-webpack-plugin');
4
5module.exports = {
6 mode: 'production',
7 entry: './index.js',
8 output: {
9 path: path.resolve(__dirname, 'dist'),
10 filename: 'node-rules.min.js',
11 libraryTarget: 'umd',
12 library: 'node-rules'
13 },
14 module: {
15 rules: [
16 {
17 test: /\.(js)$/,
18 use: 'babel-loader'
19 }
20 ]
21 },
22 optimization: {
23 minimizer: [
24 // we specify a custom UglifyJsPlugin here to get source maps in production
25 new TaserJSPlugin({
26 cache: true,
27 parallel: true,
28 terserOptions: {
29 compress: false,
30 ecma: 6,
31 mangle: true
32 },
33 sourceMap: true
34 })
35 ]
36 }
37}