-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.js
21 lines (20 loc) · 1.11 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
const path = require('path');
const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
const WooCommerceDependencyExtractionWebpackPlugin = require( '@woocommerce/dependency-extraction-webpack-plugin' );
const LiveReloadPlugin = require('webpack-livereload-plugin');
module.exports = {
...defaultConfig,
entry: {
'shipping-address-autocomplete-intl-index': path.resolve(process.cwd(), 'src', 'blocks', 'shipping-address-autocomplete-intl', 'index.js'),
'shipping-address-autocomplete-intl-frontend': path.resolve(process.cwd(), 'src', 'blocks', 'shipping-address-autocomplete-intl', 'frontend.js'),
'billing-address-autocomplete-intl-index': path.resolve(process.cwd(), 'src', 'blocks', 'billing-address-autocomplete-intl', 'index.js'),
'billing-address-autocomplete-intl-frontend': path.resolve(process.cwd(), 'src', 'blocks', 'billing-address-autocomplete-intl', 'frontend.js'),
},
plugins: [
...defaultConfig.plugins.filter(
(plugin) => plugin.constructor.name !== 'DependencyExtractionWebpackPlugin'
),
new WooCommerceDependencyExtractionWebpackPlugin(),
new LiveReloadPlugin(),
],
};