-
Notifications
You must be signed in to change notification settings - Fork 23
/
webpack.config.js
32 lines (31 loc) · 1.08 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const path = require('path');
const defaultConfig = require('@wordpress/scripts/config/webpack.config');
const TerserPlugin = require('terser-webpack-plugin');
module.exports = {
mode: 'production', // Add this line
...defaultConfig,
devtool: false,
entry: {
// Change the entry point to your specific file
index: path.resolve(__dirname, 'src/ecommerce/woocommerce/react/index.js'),
},
output: {
...defaultConfig.output,
// Change the output directory and filename
path: path.resolve(__dirname, 'src/ecommerce/woocommerce/js'),
filename: 'index.js'
},
optimization: {
minimize: true, // Ensure this is true if not already set by default in production mode
minimizer: [
new TerserPlugin({
terserOptions: {
// You can specify additional options here according to your needs
compress: {
drop_console: true, // Removes console logs for production
},
},
}),
],
},
};