forked from WordPress/wordpress-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
25 lines (21 loc) · 723 Bytes
/
webpack.config.js
File metadata and controls
25 lines (21 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const blocksConfig = require( './tools/webpack/blocks' );
const developmentConfig = require( './tools/webpack/development' );
const mediaConfig = require( './tools/webpack/media' );
const packagesConfig = require( './tools/webpack/packages' );
const modulesConfig = require( './tools/webpack/modules' );
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 ),
modulesConfig( env ),
];
return config;
};