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