Created
August 20, 2019 21:45
-
-
Save dlpetrie/db322ac7302ab1efae4b8ffe0f73b3d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); | |
module.exports = { | |
module: { | |
rules: [ | |
{ | |
include: [path.resolve(__dirname, 'src')], | |
loader: 'babel-loader', | |
options: { | |
plugins: ['syntax-dynamic-import'], | |
presets: [ | |
[ | |
'@babel/preset-env', | |
{ | |
modules: false | |
} | |
] | |
] | |
}, | |
test: /\.js$/ | |
} | |
] | |
}, | |
entry: { | |
op_session: './src/op_session.js', | |
rp_session: './src/rp_session.js', | |
}, | |
output: { | |
filename: '[name].min.js', | |
libraryTarget: 'umd', | |
}, | |
mode: 'production', | |
optimization: { | |
splitChunks: { | |
cacheGroups: { | |
vendors: { | |
priority: -10, | |
test: /[\\/]node_modules[\\/]/ | |
} | |
}, | |
chunks: 'async', | |
minChunks: 1, | |
minSize: 30000, | |
name: true | |
}, | |
minimizer: [new UglifyJSPlugin({ | |
uglifyOptions: { | |
output: { | |
comments: false, | |
}, | |
compress: { | |
drop_console: true, | |
}, | |
keep_fnames: true, | |
} | |
})], | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment