File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ const postcss = require( 'postcss' );
1313 */
1414const getBabelConfig = require ( './get-babel-config' ) ;
1515
16+ const isDev = process . env . NODE_ENV === 'development' ;
17+
1618/**
1719 * Path to packages directory.
1820 *
@@ -27,10 +29,12 @@ const PACKAGES_DIR = path
2729 *
2830 * @type {Object }
2931 */
30- const JS_ENVIRONMENTS = {
31- main : 'build' ,
32- module : 'build-module' ,
33- } ;
32+ const JS_ENVIRONMENTS = isDev
33+ ? { module : 'build-module' }
34+ : {
35+ main : 'build' ,
36+ module : 'build-module' ,
37+ } ;
3438
3539/**
3640 * Promisified fs.readFile.
Original file line number Diff line number Diff line change 274274 "build:plugin-zip" : " bash ./bin/build-plugin-zip.sh" ,
275275 "clean:package-types" : " tsc --build --clean && rimraf \" ./packages/*/build-types\" " ,
276276 "clean:packages" : " rimraf \" ./packages/*/@(build|build-module|build-style)\" " ,
277- "dev" : " npm run build:packages && concurrently \" wp-scripts start\" \" npm run dev:packages\" " ,
278- "dev:packages" : " concurrently \" node ./bin/packages/watch.js\" \" tsc --build --watch\" " ,
277+ "dev" : " cross-env NODE_ENV=development npm run build:packages && concurrently \" wp-scripts start\" \" npm run dev:packages\" " ,
278+ "dev:packages" : " cross-env NODE_ENV=development concurrently \" node ./bin/packages/watch.js\" \" tsc --build --watch\" " ,
279279 "distclean" : " git clean --force -d -X" ,
280280 "docs:api-ref" : " node ./bin/api-docs/update-api-docs.js" ,
281281 "docs:blocks" : " node ./bin/api-docs/gen-block-lib-list.js" ,
You can’t perform that action at this time.
0 commit comments