2018-11-13 19:12:32 +00:00
|
|
|
/**
|
2020-07-07 09:05:06 +00:00
|
|
|
* Internal dependencies
|
2018-11-13 19:12:32 +00:00
|
|
|
*/
|
2022-01-28 11:40:23 +00:00
|
|
|
const { NODE_ENV, getAlias } = require( './bin/webpack-helpers.js' );
|
2019-10-06 12:36:15 +00:00
|
|
|
const {
|
2020-07-07 09:05:06 +00:00
|
|
|
getCoreConfig,
|
2019-10-06 12:36:15 +00:00
|
|
|
getMainConfig,
|
|
|
|
getFrontConfig,
|
2020-07-07 09:05:06 +00:00
|
|
|
getPaymentsConfig,
|
2021-03-16 11:40:22 +00:00
|
|
|
getExtensionsConfig,
|
2023-07-31 07:03:10 +00:00
|
|
|
getSiteEditorConfig,
|
2020-07-22 12:05:56 +00:00
|
|
|
getStylingConfig,
|
2023-01-26 11:39:25 +00:00
|
|
|
getInteractivityAPIConfig,
|
2024-07-10 09:23:17 +00:00
|
|
|
getCartAndCheckoutFrontendConfig,
|
2020-07-07 09:05:06 +00:00
|
|
|
} = require( './bin/webpack-configs.js' );
|
2019-02-19 21:09:36 +00:00
|
|
|
|
2020-07-07 09:05:06 +00:00
|
|
|
// Only options shared between all configs should be defined here.
|
|
|
|
const sharedConfig = {
|
2019-07-22 09:39:00 +00:00
|
|
|
mode: NODE_ENV,
|
|
|
|
performance: {
|
|
|
|
hints: false,
|
|
|
|
},
|
|
|
|
stats: {
|
|
|
|
all: false,
|
|
|
|
assets: true,
|
|
|
|
builtAt: true,
|
|
|
|
colors: true,
|
|
|
|
errors: true,
|
|
|
|
hash: true,
|
|
|
|
timings: true,
|
|
|
|
},
|
2019-10-28 11:00:04 +00:00
|
|
|
watchOptions: {
|
|
|
|
ignored: /node_modules/,
|
|
|
|
},
|
2022-01-28 14:34:36 +00:00
|
|
|
devtool: NODE_ENV === 'development' ? 'source-map' : false,
|
2019-08-22 20:56:47 +00:00
|
|
|
};
|
|
|
|
|
2024-07-10 09:23:17 +00:00
|
|
|
const CartAndCheckoutFrontendConfig = {
|
|
|
|
...sharedConfig,
|
|
|
|
...getCartAndCheckoutFrontendConfig( { alias: getAlias() } ),
|
|
|
|
};
|
|
|
|
|
2020-07-07 09:05:06 +00:00
|
|
|
// Core config for shared libraries.
|
2019-08-22 20:56:47 +00:00
|
|
|
const CoreConfig = {
|
2020-07-07 09:05:06 +00:00
|
|
|
...sharedConfig,
|
|
|
|
...getCoreConfig( { alias: getAlias() } ),
|
2019-07-22 09:39:00 +00:00
|
|
|
};
|
|
|
|
|
2020-07-07 09:05:06 +00:00
|
|
|
// Main Blocks config for registering Blocks and for the Editor.
|
|
|
|
const MainConfig = {
|
|
|
|
...sharedConfig,
|
2020-03-31 10:46:38 +00:00
|
|
|
...getMainConfig( {
|
|
|
|
alias: getAlias(),
|
|
|
|
} ),
|
2019-10-06 12:36:15 +00:00
|
|
|
};
|
|
|
|
|
2020-07-07 09:05:06 +00:00
|
|
|
// Frontend config for scripts used in the store itself.
|
|
|
|
const FrontendConfig = {
|
|
|
|
...sharedConfig,
|
2019-10-28 13:53:09 +00:00
|
|
|
...getFrontConfig( { alias: getAlias() } ),
|
|
|
|
};
|
|
|
|
|
2021-03-16 11:40:22 +00:00
|
|
|
/**
|
|
|
|
* Config for building experimental extension scripts.
|
|
|
|
*/
|
|
|
|
const ExtensionsConfig = {
|
|
|
|
...sharedConfig,
|
|
|
|
...getExtensionsConfig( { alias: getAlias() } ),
|
|
|
|
};
|
|
|
|
|
2019-10-28 13:53:09 +00:00
|
|
|
/**
|
2020-08-25 10:01:19 +00:00
|
|
|
* Config for building the payment methods integration scripts.
|
2019-10-28 13:53:09 +00:00
|
|
|
*/
|
2020-07-07 09:05:06 +00:00
|
|
|
const PaymentsConfig = {
|
|
|
|
...sharedConfig,
|
|
|
|
...getPaymentsConfig( { alias: getAlias() } ),
|
|
|
|
};
|
2019-10-28 13:53:09 +00:00
|
|
|
|
2020-07-22 12:05:56 +00:00
|
|
|
/**
|
|
|
|
* Config to generate the CSS files.
|
|
|
|
*/
|
|
|
|
const StylingConfig = {
|
|
|
|
...sharedConfig,
|
2023-09-08 04:15:48 +00:00
|
|
|
...getStylingConfig( { alias: getAlias() } ),
|
2020-07-22 12:05:56 +00:00
|
|
|
};
|
|
|
|
|
2023-01-26 11:39:25 +00:00
|
|
|
/**
|
|
|
|
* Config to generate the Interactivity API runtime.
|
|
|
|
*/
|
|
|
|
const InteractivityConfig = {
|
|
|
|
...sharedConfig,
|
|
|
|
...getInteractivityAPIConfig( { alias: getAlias() } ),
|
|
|
|
};
|
|
|
|
|
2023-07-31 07:03:10 +00:00
|
|
|
/**
|
|
|
|
* Config to generate the site editor scripts.
|
|
|
|
*/
|
|
|
|
const SiteEditorConfig = {
|
|
|
|
...sharedConfig,
|
|
|
|
...getSiteEditorConfig( { alias: getAlias() } ),
|
|
|
|
};
|
|
|
|
|
2019-10-06 12:36:15 +00:00
|
|
|
module.exports = [
|
2024-07-10 09:23:17 +00:00
|
|
|
CartAndCheckoutFrontendConfig,
|
2019-10-06 12:36:15 +00:00
|
|
|
CoreConfig,
|
2020-07-07 09:05:06 +00:00
|
|
|
MainConfig,
|
|
|
|
FrontendConfig,
|
2021-03-16 11:40:22 +00:00
|
|
|
ExtensionsConfig,
|
2020-07-07 09:05:06 +00:00
|
|
|
PaymentsConfig,
|
2023-07-31 07:03:10 +00:00
|
|
|
SiteEditorConfig,
|
2020-07-22 12:05:56 +00:00
|
|
|
StylingConfig,
|
2023-01-26 11:39:25 +00:00
|
|
|
InteractivityConfig,
|
2019-10-06 12:36:15 +00:00
|
|
|
];
|