-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
33 lines (32 loc) · 1.13 KB
/
webpack.config.js
File metadata and controls
33 lines (32 loc) · 1.13 KB
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
const defaultConfig = require('@wordpress/scripts/config/webpack.config');
const BrowserSyncPlugin = require('browser-sync-webpack-plugin');
const path = require('path');
module.exports = {
...defaultConfig,
entry: {
// Block entries - output to src/blocks for WordPress block registration
'modal/index': path.resolve(__dirname, 'src/blocks/modal/index.tsx'),
'modal/view': path.resolve(__dirname, 'src/blocks/modal/view.ts'),
'modal/style': path.resolve(__dirname, 'src/blocks/modal/style.scss'),
},
output: {
path: path.resolve(__dirname, 'src/blocks'),
filename: '[name].js',
},
plugins: [
...defaultConfig.plugins,
new BrowserSyncPlugin({
host: 'localhost',
port: 8882,
proxy: 'http://localhost:8881', // Replace with your Local WP site URL
files: [
'./**/*.php',
'./**/*.css',
'./**/*.js',
'!./node_modules',
'!./vendor'
],
open: false // Prevents opening a new browser window automatically
})
]
};