-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
38 lines (37 loc) · 1 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
33
34
35
36
37
38
const defaultConfig = require('@wordpress/scripts/config/webpack.config');
const RemoveEmptyScriptsPlugin = require('webpack-remove-empty-scripts');
const path = require('path');
module.exports = {
...defaultConfig,
entry: {
'blocks/full-name/index': path.resolve(
process.cwd(),
'src/blocks/full-name/index.js',
),
'blocks/phone/index': path.resolve(
process.cwd(),
'src/blocks/phone/index.js',
),
'blocks/social-links/index': path.resolve(
process.cwd(),
'src/blocks/social-links/index.js',
),
'blocks/email/index': path.resolve(
process.cwd(),
'src/blocks/email/index.js',
),
'admin/index': path.resolve(process.cwd(), 'src/admin/index.js'),
'editor/index': path.resolve(process.cwd(), 'src/editor/index.js'),
},
output: {
...defaultConfig.output,
path: path.resolve(process.cwd(), 'build'),
filename: '[name].js',
},
plugins: [
...defaultConfig.plugins,
new RemoveEmptyScriptsPlugin({
stage: RemoveEmptyScriptsPlugin.STAGE_AFTER_PROCESS_PLUGINS,
}),
],
};