/** * Internal dependencies */ const { NODE_ENV, getAlias } = require( './bin/webpack-helpers.js' ); const { getCoreConfig, getMainConfig, getFrontConfig, getPaymentsConfig, getExtensionsConfig, getStylingConfig, getInteractivityAPIConfig, } = require( './bin/webpack-configs.js' ); // Only options shared between all configs should be defined here. const sharedConfig = { mode: NODE_ENV, performance: { hints: false, }, stats: { all: false, assets: true, builtAt: true, colors: true, errors: true, hash: true, timings: true, }, watchOptions: { ignored: /node_modules/, }, devtool: NODE_ENV === 'development' ? 'source-map' : false, }; // Core config for shared libraries. const CoreConfig = { ...sharedConfig, ...getCoreConfig( { alias: getAlias() } ), }; // Main Blocks config for registering Blocks and for the Editor. const MainConfig = { ...sharedConfig, ...getMainConfig( { alias: getAlias(), } ), }; // Frontend config for scripts used in the store itself. const FrontendConfig = { ...sharedConfig, ...getFrontConfig( { alias: getAlias() } ), }; /** * Config for building experimental extension scripts. */ const ExtensionsConfig = { ...sharedConfig, ...getExtensionsConfig( { alias: getAlias() } ), }; /** * Config for building the payment methods integration scripts. */ const PaymentsConfig = { ...sharedConfig, ...getPaymentsConfig( { alias: getAlias() } ), }; /** * Config to generate the CSS files. */ const StylingConfig = { ...sharedConfig, ...getStylingConfig( { alias: getAlias() } ), }; /** * Config to generate the Interactivity API runtime. */ const InteractivityConfig = { ...sharedConfig, ...getInteractivityAPIConfig( { alias: getAlias() } ), }; module.exports = [ CoreConfig, MainConfig, FrontendConfig, ExtensionsConfig, PaymentsConfig, StylingConfig, InteractivityConfig, ];