-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
34 lines (29 loc) · 827 Bytes
/
webpack.config.js
File metadata and controls
34 lines (29 loc) · 827 Bytes
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
33
34
// Import the default webpack config from @wordpress/scripts
const defaultConfig = require('@wordpress/scripts/config/webpack.config');
const path = require('path');
module.exports = {
...defaultConfig,
// Explicitly set the mode
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
// Watch mode settings
watchOptions: {
// Force use of polling (no fsevents)
poll: 1000,
// Ignore node_modules
ignored: /node_modules/,
// Add delay before rebuilding
aggregateTimeout: 500,
},
// Explicitly disable fsevents
snapshot: {
managedPaths: [path.resolve(__dirname, 'node_modules')],
},
// Prevent webpack from watching too many files
stats: {
all: false,
assets: true,
errors: true,
errorDetails: true,
warnings: true,
}
};