2021-07-28 10:05:01 +00:00
|
|
|
const blocksConfig = require( './tools/webpack/blocks' );
|
2022-04-11 16:08:12 +00:00
|
|
|
const developmentConfig = require( './tools/webpack/development' );
|
2018-12-13 15:25:37 +00:00
|
|
|
const mediaConfig = require( './tools/webpack/media' );
|
|
|
|
const packagesConfig = require( './tools/webpack/packages' );
|
2024-09-24 07:33:55 +00:00
|
|
|
const scriptModulesConfig = require( './tools/webpack/script-modules' );
|
2024-05-31 17:54:41 +00:00
|
|
|
const vendorsConfig = require( './tools/webpack/vendors' );
|
2018-12-13 11:04:35 +00:00
|
|
|
|
2018-12-24 13:28:22 +00:00
|
|
|
module.exports = function( env = { environment: "production", watch: false, buildTarget: false } ) {
|
2018-12-13 15:25:37 +00:00
|
|
|
if ( ! env.watch ) {
|
|
|
|
env.watch = false;
|
|
|
|
}
|
2017-10-04 21:00:15 +00:00
|
|
|
|
2018-12-24 13:28:22 +00:00
|
|
|
if ( ! env.buildTarget ) {
|
|
|
|
env.buildTarget = ( env.mode === 'production' ? 'build/' : 'src/' );
|
2018-12-16 23:27:36 +00:00
|
|
|
}
|
|
|
|
|
2018-12-13 15:25:37 +00:00
|
|
|
const config = [
|
2021-07-28 10:05:01 +00:00
|
|
|
blocksConfig( env ),
|
2022-04-11 16:08:12 +00:00
|
|
|
...developmentConfig( env ),
|
2018-12-13 15:25:37 +00:00
|
|
|
mediaConfig( env ),
|
|
|
|
packagesConfig( env ),
|
2024-09-24 07:33:55 +00:00
|
|
|
scriptModulesConfig( env ),
|
2024-05-31 17:54:41 +00:00
|
|
|
...vendorsConfig( env ),
|
2018-12-13 15:25:37 +00:00
|
|
|
];
|
2018-12-11 16:38:21 +00:00
|
|
|
|
2018-12-13 15:25:37 +00:00
|
|
|
return config;
|
2018-12-11 16:38:21 +00:00
|
|
|
};
|