UNPKG

771 BJavaScriptView Raw
1const path = require('path');
2const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
3
4module.exports = {
5 watch: true,
6 devtool: 'source-map',
7 entry: './src/index.js',
8 output: {
9 path: path.resolve(__dirname, 'dist'),
10 filename: 'objectexporter.min.js'
11 },
12 module: {
13 rules: [
14 {
15 test: /\.js$/,
16 exclude: /(node_modules|bower_components)/,
17 use: {
18 loader: "babel-loader",
19 options: {
20 presets: ["@babel/preset-env"]
21 }
22 }
23 }
24 ]
25},
26 optimization: {
27 minimize: true,
28 minimizer: [new UglifyJsPlugin({
29 include: /\.min\.js$/,
30 uglifyOptions: {
31 output: {
32 comments: false
33 }
34 }
35 })]
36 }
37};
\No newline at end of file