Merge pull request woocommerce/woocommerce-admin#2060 from woocommerce/fix/2053

update path to feature-config-core.php
This commit is contained in:
Ron Rennick 2019-04-25 12:25:22 -03:00 committed by GitHub
commit c0171f952e
2 changed files with 7 additions and 2 deletions

View File

@ -7,7 +7,7 @@
$phase = isset( $_SERVER['WC_ADMIN_PHASE'] ) ? $_SERVER['WC_ADMIN_PHASE'] : ''; // WPCS: sanitization ok.
if ( ! in_array( $phase, array( 'development', 'plugin', 'core' ), true ) ) {
$phase = 'core';
$phase = 'development';
}
$config_json = file_get_contents( 'config/' . $phase . '.json' );
$config = json_decode( $config_json );
@ -35,6 +35,11 @@ if ( 'core' !== $phase ) {
}
$write .= "\t\t\t)";
if ( ! is_dir( './dist' ) && ! @mkdir( './dist' ) ) {
echo "Run `npm run clean` to wipe artifacts.\n\n";
exit( 1 );
}
$config_file = fopen( 'dist/feature-config-core.php', 'w' );
}

View File

@ -22,7 +22,7 @@
"build": "npm run build:feature-config && npm run build:packages && npm run build:core",
"postbuild": "npm run -s i18n:php && npm run -s i18n:pot",
"build:core": "cross-env NODE_ENV=production webpack",
"build:feature-config": "php bin/generate-feature-config.php",
"build:feature-config": "WC_ADMIN_PHASE=core php bin/generate-feature-config.php",
"build:packages": "node ./bin/packages/build.js",
"build:release": "cross-env WC_ADMIN_PHASE=plugin ./bin/build-plugin-zip.sh",
"clean": "rimraf ./dist ./packages/*/build ./packages/*/build-module ./packages/*/build-style",