@@ -9,7 +9,6 @@ const DependencyExtractionWebpackPlugin = require( '@wordpress/dependency-extrac
99const WebpackRTLPlugin = require ( 'webpack-rtl-plugin' ) ;
1010const chalk = require ( 'chalk' ) ;
1111const { omit } = require ( 'lodash' ) ;
12- const { DefinePlugin } = require ( 'webpack' ) ;
1312const NODE_ENV = process . env . NODE_ENV || 'development' ;
1413
1514function findModuleMatch ( module , match ) {
@@ -149,16 +148,17 @@ const stableMainEntry = {
149148 'active-filters' : './assets/js/blocks/active-filters/index.js' ,
150149 'block-error-boundary' :
151150 './assets/js/base/components/block-error-boundary/style.scss' ,
152- 'single-product' : './assets/js/blocks/single-product/index.js' ,
151+ cart : './assets/js/blocks/cart-checkout/cart/index.js' ,
152+ checkout : './assets/js/blocks/cart-checkout/checkout/index.js' ,
153153} ;
154154
155155const experimentalMainEntry = {
156- cart : './assets/js/blocks/cart-checkout/cart/index.js' ,
157- checkout : './assets/js/blocks/cart-checkout/checkout/index.js' ,
156+ 'single-product' : './assets/js/blocks/single-product/index.js' ,
158157} ;
159158
160159const mainEntry =
161- process . env . WOOCOMMERCE_BLOCKS_PHASE === 'stable'
160+ // env variables are strings, so we compare against a string, so we need to parse it.
161+ parseInt ( process . env . WOOCOMMERCE_BLOCKS_PHASE , 10 ) < 3
162162 ? stableMainEntry
163163 : { ...stableMainEntry , ...experimentalMainEntry } ;
164164
@@ -168,16 +168,17 @@ const stableFrontEndEntry = {
168168 'price-filter' : './assets/js/blocks/price-filter/frontend.js' ,
169169 'attribute-filter' : './assets/js/blocks/attribute-filter/frontend.js' ,
170170 'active-filters' : './assets/js/blocks/active-filters/frontend.js' ,
171- 'single-product' : './assets/js/blocks/single-product/frontend.js' ,
171+ cart : './assets/js/blocks/cart-checkout/cart/frontend.js' ,
172+ checkout : './assets/js/blocks/cart-checkout/checkout/frontend.js' ,
172173} ;
173174
174175const experimentalFrontEndEntry = {
175- cart : './assets/js/blocks/cart-checkout/cart/frontend.js' ,
176- checkout : './assets/js/blocks/cart-checkout/checkout/frontend.js' ,
176+ 'single-product' : './assets/js/blocks/single-product/frontend.js' ,
177177} ;
178178
179179const frontEndEntry =
180- process . env . WOOCOMMERCE_BLOCKS_PHASE === 'stable'
180+ // env variables are strings, so we compare against a string, so we need to parse it.
181+ parseInt ( process . env . WOOCOMMERCE_BLOCKS_PHASE , 10 ) < 3
181182 ? stableFrontEndEntry
182183 : { ...stableFrontEndEntry , ...experimentalFrontEndEntry } ;
183184
@@ -358,13 +359,6 @@ const getMainConfig = ( options = {} ) => {
358359 requestToExternal,
359360 requestToHandle,
360361 } ) ,
361- new DefinePlugin ( {
362- // Inject the `WOOCOMMERCE_BLOCKS_PHASE` global, used for feature flagging.
363- 'process.env.WOOCOMMERCE_BLOCKS_PHASE' : JSON . stringify (
364- // eslint-disable-next-line woocommerce/feature-flag
365- process . env . WOOCOMMERCE_BLOCKS_PHASE || 'experimental'
366- ) ,
367- } ) ,
368362 ] ,
369363 resolve,
370364 } ;
@@ -460,13 +454,6 @@ const getFrontConfig = ( options = {} ) => {
460454 requestToExternal,
461455 requestToHandle,
462456 } ) ,
463- new DefinePlugin ( {
464- // Inject the `WOOCOMMERCE_BLOCKS_PHASE` global, used for feature flagging.
465- 'process.env.WOOCOMMERCE_BLOCKS_PHASE' : JSON . stringify (
466- // eslint-disable-next-line woocommerce/feature-flag
467- process . env . WOOCOMMERCE_BLOCKS_PHASE || 'experimental'
468- ) ,
469- } ) ,
470457 ] ,
471458 resolve,
472459 } ;
@@ -599,13 +586,6 @@ const getPaymentMethodsExtensionConfig = ( options = {} ) => {
599586 requestToExternal,
600587 requestToHandle,
601588 } ) ,
602- new DefinePlugin ( {
603- // Inject the `WOOCOMMERCE_BLOCKS_PHASE` global, used for feature flagging.
604- 'process.env.WOOCOMMERCE_BLOCKS_PHASE' : JSON . stringify (
605- // eslint-disable-next-line woocommerce/feature-flag
606- process . env . WOOCOMMERCE_BLOCKS_PHASE || 'experimental'
607- ) ,
608- } ) ,
609589 ] ,
610590 resolve,
611591 } ;
0 commit comments