-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
36 lines (35 loc) · 1.1 KB
/
webpack.config.js
File metadata and controls
36 lines (35 loc) · 1.1 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
34
35
36
const defaultConfig = require('@wordpress/scripts/config/webpack.config');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const path = require('path');
const RemoveEmptyScriptsPlugin = require('webpack-remove-empty-scripts');
module.exports = [
{
...defaultConfig,
entry: {
...defaultConfig.entry(),
'css/insertcodes-admin': './src/css/insertcodes-admin.scss',
'js/insertcodes-admin': './src/js/insertcodes-admin.js',
},
output: {
...defaultConfig.output,
filename: '[name].js',
path: __dirname + '/assets/',
},
plugins: [
...defaultConfig.plugins,
// Copy images to the build folder.
// new CopyWebpackPlugin({
// patterns: [
// {
// from: path.resolve(__dirname, 'src/images'),
// to: path.resolve(__dirname, 'assets/images'),
// }
// ]
// }),
new RemoveEmptyScriptsPlugin({
stage: RemoveEmptyScriptsPlugin.STAGE_AFTER_PROCESS_PLUGINS,
remove: /\.(js)$/,
}),
],
},
];