-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
39 lines (38 loc) · 995 Bytes
/
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
39
const path = require('path');
module.exports = {
mode: 'production',
entry: {
'meta-sidebar': './assets/js/meta-sidebar.js'
},
output: {
path: path.resolve(__dirname, 'assets/js'),
filename: '[name].min.js'
},
module: {
rules: [{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
}]
},
externals: {
'lodash': 'lodash',
'@wordpress/data': 'wp.data',
'@wordpress/i18n': 'wp.i18n',
'@wordpress/hooks': 'wp.hooks',
'@wordpress/blocks': 'wp.blocks',
'@wordpress/editor': 'wp.editor',
'@wordpress/plugins': 'wp.plugins',
'@wordpress/compose': 'wp.compose',
'@wordpress/element': 'wp.element',
'@wordpress/api-fetch': 'wp.apiFetch',
'@wordpress/edit-post': 'wp.editPost',
'@wordpress/components': 'wp.components',
'@wordpress/block-editor': 'wp.blockEditor',
'@wordpress/html-entities': 'wp.htmlEntities'
},
watch: true,
watchOptions: {
ignored: ['**/*.min.js']
}
}