Answer the question
In order to leave comments, you need to log in
How to overwrite an array in an object from the config?
Hi all. I use import config like this:
const defaultConfig = require('./node_modules/@wordpress/scripts/config/webpack.config.js');
const path = require('path');
const production = process.env.NODE_ENV === '';
module.exports = {
...defaultConfig,
output: {
path: path.resolve(__dirname, 'assets/build'),
filename: '[name].js',
},
optimization: {
...defaultConfig.optimization,
},
module: {
...defaultConfig.module,
rules: [
...defaultConfig.module.rules,
],
},
plugins: [...defaultConfig.plugins],
};
{
test: /\.(woff|woff2|eot|ttf|otf)$/,
use: [
{
loader: 'file-loader',
options: {
name: 'fonts/[name].[hash:8].[ext]',
},
},
],
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question