mirror of
git://develop.git.wordpress.org/
synced 2025-01-16 20:38:35 +01:00
b726922bb9
Brings the same functionality introduced in the Gutenberg plugin with https://github.com/WordPress/gutenberg/pull/28273. In effect, it brings React Fast Refresh support to WordPress core for block development with `@wordpress/scripts`. Props walbo, antonvlasenko. See #51750, #55505. Follow-up [53135]. git-svn-id: https://develop.svn.wordpress.org/trunk@53140 602fd350-edb4-49c9-b593-d223f7449a82
24 lines
639 B
JavaScript
24 lines
639 B
JavaScript
const blocksConfig = require( './tools/webpack/blocks' );
|
|
const developmentConfig = require( './tools/webpack/development' );
|
|
const mediaConfig = require( './tools/webpack/media' );
|
|
const packagesConfig = require( './tools/webpack/packages' );
|
|
|
|
module.exports = function( env = { environment: "production", watch: false, buildTarget: false } ) {
|
|
if ( ! env.watch ) {
|
|
env.watch = false;
|
|
}
|
|
|
|
if ( ! env.buildTarget ) {
|
|
env.buildTarget = ( env.mode === 'production' ? 'build/' : 'src/' );
|
|
}
|
|
|
|
const config = [
|
|
blocksConfig( env ),
|
|
...developmentConfig( env ),
|
|
mediaConfig( env ),
|
|
packagesConfig( env ),
|
|
];
|
|
|
|
return config;
|
|
};
|