2023-06-08 20:20:05 +00:00
|
|
|
const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
|
|
|
|
const WooCommerceDependencyExtractionWebpackPlugin = require( '@woocommerce/dependency-extraction-webpack-plugin' );
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
...defaultConfig,
|
|
|
|
entry: {
|
|
|
|
...defaultConfig.entry,
|
2023-08-15 20:10:21 +00:00
|
|
|
settings: './src/settings/settings.ts',
|
2023-06-08 20:20:05 +00:00
|
|
|
},
|
|
|
|
module: {
|
|
|
|
...defaultConfig.module,
|
|
|
|
rules: [
|
|
|
|
...defaultConfig.module.rules,
|
|
|
|
{
|
|
|
|
test: /\.tsx?$/,
|
|
|
|
use: 'ts-loader',
|
|
|
|
exclude: /node_modules/,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(png|jp(e*)g|svg|gif)$/,
|
|
|
|
type: 'asset/resource',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
extensions: [ '.js', '.jsx', '.tsx', '.ts' ],
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
...defaultConfig.plugins.filter(
|
|
|
|
( plugin ) =>
|
|
|
|
plugin.constructor.name !== 'DependencyExtractionWebpackPlugin'
|
|
|
|
),
|
|
|
|
new WooCommerceDependencyExtractionWebpackPlugin(),
|
|
|
|
],
|
|
|
|
};
|