cognitoforms-wordpress/webpack.config.js

43 lines
817 B
JavaScript
Raw Normal View History

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',
},
{
test: /\.scss$/,
use: [ 'style-loader', 'sass-loader' ],
},
...defaultConfig.module.rules,
],
},
resolve: {
...defaultConfig.resolve,
alias: {
"@": path.resolve( __dirname, 'src' ),
},
extensions: [ '.tsx', '.ts', '.js', '.jsx' ],
},
output: {
...defaultConfig.output,
filename: 'index.js',
path: path.resolve( __dirname, 'dist' ),
},
};