Successfully added
React
by Patrik
Configure Webpack For Production
webpack.config.prd.js
const path = require('path'); | |
const TerserPlugin = require('terser-webpack-plugin'); | |
module.exports = { | |
mode: 'production', | |
entry: './src/index.jsx', | |
output: { | |
path: path.resolve(__dirname, '../wwwroot/dist/js'), | |
filename: 'snippset.min.js' | |
}, | |
optimization: { | |
minimize: true, | |
minimizer: [ | |
new TerserPlugin({ | |
terserOptions: { | |
format: { | |
comments: false, | |
}, | |
}, | |
extractComments: false, | |
}), | |
], | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.jsx$/, | |
exclude: /(node_modules)/, | |
use: [{ | |
loader: 'babel-loader', | |
} | |
] | |
} | |
] | |
}, | |
resolve: { | |
extensions: ['.js', '.jsx'] | |
} | |
}; |
Remove Comments
Referenced in:
Comments