2022-01-13 18:26:04 -05:00
|
|
|
const path = require( 'path' );
|
|
|
|
const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
...defaultConfig,
|
|
|
|
entry: './src/index.tsx',
|
|
|
|
module: {
|
|
|
|
...defaultConfig.module,
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.tsx?$/,
|
|
|
|
use: 'ts-loader',
|
|
|
|
exclude: /node_modules/,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.svg$/,
|
2022-01-26 13:58:38 -05:00
|
|
|
issuer: /\.tsx?$/,
|
|
|
|
use: [ '@svgr/webpack', 'url-loader' ],
|
|
|
|
type: 'javascript/auto',
|
2022-01-13 18:26:04 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.scss$/,
|
2022-01-22 22:19:32 -05:00
|
|
|
use: [ 'style-loader', 'sass-loader' ],
|
2022-01-13 18:26:04 -05:00
|
|
|
},
|
|
|
|
...defaultConfig.module.rules,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
resolve: {
|
|
|
|
...defaultConfig.resolve,
|
2022-01-22 22:19:32 -05:00
|
|
|
alias: {
|
|
|
|
"@": path.resolve( __dirname, 'src' ),
|
|
|
|
},
|
|
|
|
extensions: [ '.tsx', '.ts', '.js', '.jsx' ],
|
2022-01-13 18:26:04 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
output: {
|
|
|
|
...defaultConfig.output,
|
|
|
|
filename: 'index.js',
|
|
|
|
path: path.resolve( __dirname, 'dist' ),
|
|
|
|
},
|
|
|
|
};
|