splitting out libraries
This commit is contained in:
+27
-1
@@ -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
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user