| 1 |
const defaultConfig = require( '@wordpress/scripts/config/webpack.config' ); |
| 2 |
const WooCommerceDependencyExtractionWebpackPlugin = require( '@woocommerce/dependency-extraction-webpack-plugin' ); |
| 3 |
const { resolve } = require( 'path' ); |
| 4 |
|
| 5 |
module.exports = { |
| 6 |
...defaultConfig, |
| 7 |
output: { |
| 8 |
...defaultConfig.output, |
| 9 |
path: resolve( process.cwd(), 'public/block' ), |
| 10 |
}, |
| 11 |
plugins: [ |
| 12 |
...defaultConfig.plugins.filter( |
| 13 |
( plugin ) => |
| 14 |
plugin.constructor.name !== 'DependencyExtractionWebpackPlugin' |
| 15 |
), |
| 16 |
new WooCommerceDependencyExtractionWebpackPlugin(), |
| 17 |
], |
| 18 |
}; |
| 19 |
|