-
Notifications
You must be signed in to change notification settings - Fork 31
/
webpack.config.js
27 lines (26 loc) · 964 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
const defaultConfig = require('@wordpress/scripts/config/webpack.config');
const WooDependencyExtractionWebpackPlugin = require('@woocommerce/dependency-extraction-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const RemoveEmptyScriptsPlugin = require('webpack-remove-empty-scripts');
module.exports = {
...defaultConfig,
entry: {
...defaultConfig.entry,
'js/frontend/booking-form': './src/js/booking-form.js', // prettier-ignore
'js/admin/writepanel': './src/js/writepanel.js', // prettier-ignore
'css/frontend': './src/css/frontend.scss', // prettier-ignore
},
plugins: [
...defaultConfig.plugins.filter(
(plugin) =>
plugin.constructor.name !== 'DependencyExtractionWebpackPlugin'
),
new WooDependencyExtractionWebpackPlugin(),
new MiniCssExtractPlugin({
filename: `[name].css`,
}),
new RemoveEmptyScriptsPlugin({
stage: RemoveEmptyScriptsPlugin.STAGE_AFTER_PROCESS_PLUGINS,
}),
],
};