wpmind/webpack.config.js

32 lines
649 B
JavaScript
Raw Normal View History

/**
* External Dependencies
*/
const { resolve } = require('path');
2023-07-14 10:35:15 +03:00
const defaultConfig = require('@wordpress/scripts/config/webpack.config');
const isProduction = process.env.NODE_ENV === 'production';
const newConfig = {
...defaultConfig,
...{
entry: {
admin: resolve(process.cwd(), 'src/admin', 'index.js'),
editor: resolve(process.cwd(), 'src/editor', 'index.js'),
},
},
2023-07-14 10:35:15 +03:00
// Display minimum info in terminal.
stats: 'minimal',
};
// Development only.
if (!isProduction) {
newConfig.devServer = {
...newConfig.devServer,
// Support for dev server on all domains.
allowedHosts: 'all',
};
}
module.exports = newConfig;