wpmind/webpack.config.js
Nikita f1c3c698dc added Welcome page
changed settings API and page to React + rest
changed structure of scripts - different folders for editor and admin scripts
2023-08-05 16:01:44 +03:00

31 lines
649 B
JavaScript

/**
* External Dependencies
*/
const { resolve } = require('path');
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'),
},
},
// 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;