mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-14 13:46:55 +03:00
54 lines
1.1 KiB
JavaScript
54 lines
1.1 KiB
JavaScript
|
const path = require('path');
|
||
|
const TerserPlugin = require('terser-webpack-plugin');
|
||
|
|
||
|
module.exports = (env = {}) => (
|
||
|
{
|
||
|
mode: 'production',
|
||
|
entry: {
|
||
|
app: ['./src/index.js']
|
||
|
},
|
||
|
output: {
|
||
|
library: 'ReactJsonTree',
|
||
|
libraryTarget: 'umd',
|
||
|
path: path.resolve(__dirname, 'umd'),
|
||
|
filename: env.minimize ? 'react-json-tree.min.js' : 'react-json-tree.js'
|
||
|
},
|
||
|
module: {
|
||
|
rules: [
|
||
|
{
|
||
|
test: /\.js$/,
|
||
|
loader: 'babel-loader',
|
||
|
exclude: /node_modules/
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
externals: {
|
||
|
react: {
|
||
|
root: 'React',
|
||
|
commonjs2: 'react',
|
||
|
commonjs: 'react',
|
||
|
amd: 'react'
|
||
|
},
|
||
|
'react-dom': {
|
||
|
root: 'ReactDOM',
|
||
|
commonjs2: 'react-dom',
|
||
|
commonjs: 'react-dom',
|
||
|
amd: 'react-dom'
|
||
|
}
|
||
|
},
|
||
|
optimization: {
|
||
|
minimize: !!env.minimize,
|
||
|
minimizer: [
|
||
|
new TerserPlugin({
|
||
|
terserOptions: {
|
||
|
safari10: true
|
||
|
}
|
||
|
})
|
||
|
]
|
||
|
},
|
||
|
performance: {
|
||
|
hints: false
|
||
|
}
|
||
|
}
|
||
|
);
|