Working on pipeline stuff
This commit is contained in:
+37
-35
@@ -1,38 +1,40 @@
|
||||
const TerserPlugin = require('terser-webpack-plugin');
|
||||
|
||||
module.exports = {
|
||||
entry: './src/index.jsx',
|
||||
output: {
|
||||
path: __dirname + '/public/',
|
||||
filename: 'app.bundle.js',
|
||||
sourceMapFilename: 'app.js.map'
|
||||
},
|
||||
devtool: 'source-map',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /(\.js$|\.jsx$)/,
|
||||
exclude: /(node_modules)/,
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: ['@babel/preset-env', '@babel/preset-react'],
|
||||
plugins: ['react-loadable/babel', '@babel/plugin-syntax-dynamic-import']
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
optimization: {
|
||||
minimize: process.env.production,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
terserOptions: {
|
||||
output: {
|
||||
comments: false,
|
||||
},
|
||||
},
|
||||
})
|
||||
]
|
||||
}
|
||||
module.exports = env => {
|
||||
return {
|
||||
entry: `./src/index${env === 'production' ? '' : '_dev'}.jsx`,
|
||||
output: {
|
||||
path: __dirname + '/public/',
|
||||
filename: 'app.bundle.js',
|
||||
sourceMapFilename: 'app.bundle.js.map'
|
||||
},
|
||||
devtool: 'source-map',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /(\.js$|\.jsx$)/,
|
||||
exclude: /(node_modules)/,
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: ['@babel/preset-env', '@babel/preset-react'],
|
||||
plugins: ['react-loadable/babel', '@babel/plugin-syntax-dynamic-import']
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
optimization: {
|
||||
minimize: env === 'production',
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
terserOptions: {
|
||||
output: {
|
||||
comments: false,
|
||||
},
|
||||
},
|
||||
})
|
||||
]
|
||||
}
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user