woocommerce/plugins/woocommerce-beta-tester/webpack.config.js

34 lines
873 B
JavaScript
Raw Permalink Normal View History

2022-06-07 03:18:37 +00:00
const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
const WooCommerceDependencyExtractionWebpackPlugin = require( '@woocommerce/dependency-extraction-webpack-plugin' );
const path = require( 'path' );
2022-06-07 03:18:37 +00:00
module.exports = {
...defaultConfig,
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',
include: [ path.resolve( __dirname, './src/' ) ],
},
],
},
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(),
],
};