2022-06-07 03:18:37 +00:00
|
|
|
const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
|
|
|
|
const WooCommerceDependencyExtractionWebpackPlugin = require( '@woocommerce/dependency-extraction-webpack-plugin' );
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
...defaultConfig,
|
2022-11-30 01:17:27 +00:00
|
|
|
entry: {
|
|
|
|
...defaultConfig.entry,
|
|
|
|
// Separate entry point for the live-branches page.
|
|
|
|
'live-branches': './src/live-branches/index.tsx',
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
...defaultConfig.module,
|
|
|
|
rules: [
|
|
|
|
...defaultConfig.module.rules,
|
|
|
|
{
|
|
|
|
test: /\.tsx?$/,
|
|
|
|
use: 'ts-loader',
|
|
|
|
exclude: /node_modules/,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
extensions: [ '.js', '.jsx', '.tsx', '.ts' ],
|
|
|
|
},
|
2022-06-07 03:18:37 +00:00
|
|
|
plugins: [
|
|
|
|
...defaultConfig.plugins.filter(
|
|
|
|
( plugin ) =>
|
|
|
|
plugin.constructor.name !== 'DependencyExtractionWebpackPlugin'
|
|
|
|
),
|
|
|
|
new WooCommerceDependencyExtractionWebpackPlugin(),
|
|
|
|
],
|
|
|
|
};
|