splitting out libraries

This commit is contained in:
or-else
2018-10-31 19:44:07 +03:00
parent e7f3b424e4
commit c76a7dcb6b
6 changed files with 165 additions and 693 deletions
+27 -1
View File
@@ -1,4 +1,6 @@
module.exports = config = {
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
module.exports = config = {
entry: [
'./src/index.js',
],
@@ -13,4 +15,28 @@ module.exports = config = {
},
],
},
output: {
libraryTarget: 'umd'
},
optimization: {
minimizer: [
// we specify a custom UglifyJsPlugin here to get source maps in production.
new UglifyJsPlugin({
cache: true,
parallel: true,
uglifyOptions: {
compress: true,
mangle: true
},
sourceMap: true
})
]
},
externals: {
'react': 'React',
'react-dom': 'ReactDOM',
'react-intl': 'ReactIntl',
'firebase/app': 'firebase',
'firebase/messaging': true
},
};