From 74a0d6c1a7c4feb59a2c504cefb6881b44457462 Mon Sep 17 00:00:00 2001 From: "Jake F - @samouri" Date: Fri, 10 Feb 2017 17:45:22 -1000 Subject: [PATCH] fix tests --- .gitignore | 2 +- Makefile | 1 + client/config/index.js | 7 +++---- server/bundler/bin/bundler.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 88bc4ab059993f..ef8923273fc2c1 100644 --- a/.gitignore +++ b/.gitignore @@ -38,7 +38,7 @@ env-config.sh /server/devdocs/search-index.js /server/devdocs/components-usage-stats.json /server/devdocs/proptypes-index.json -/server/bundler/assets-*.json +/server/bundler/assets.json *.rdb *.db diff --git a/Makefile b/Makefile index 30e4e0ccf4ba76..08c1e2098d906d 100644 --- a/Makefile +++ b/Makefile @@ -164,6 +164,7 @@ build-server: install @CALYPSO_ENV=$(CALYPSO_ENV) $(NODE_BIN)/webpack --display-error-details --config webpack.config.node.js build: install build-server build-dll build-css server/devdocs/search-index.js server/devdocs/proptypes-index.json server/devdocs/components-usage-stats.json + @$(BUNDLER) build-css: public/style.css public/style-rtl.css public/style-debug.css public/editor.css diff --git a/client/config/index.js b/client/config/index.js index fce3733ce4a557..e5c492299f3d38 100644 --- a/client/config/index.js +++ b/client/config/index.js @@ -1,12 +1,11 @@ let config; -if ( typeof window !== 'undefined' ) { + +if ( typeof window !== 'undefined' && window.config ) { config = window.config; config.anyEnabled = window.anyEnabled; config.isEnabled = window.isEnabled; } else { - config = () => false; - config.isEnabled = () => false; - config.anyEnabled = () => false; + throw new Error( 'config not available' ); } export default config; diff --git a/server/bundler/bin/bundler.js b/server/bundler/bin/bundler.js index 5316378817adc3..9f9d48b0751ee1 100755 --- a/server/bundler/bin/bundler.js +++ b/server/bundler/bin/bundler.js @@ -89,7 +89,7 @@ webpack( webpackConfig, function( error, stats ) { assets = utils.getAssets( stats.toJson() ); - fs.writeFileSync( path.join( __dirname, '..', 'assets-' + CALYPSO_ENV + '.json' ), JSON.stringify( assets, null, '\t' ) ); + fs.writeFileSync( path.join( __dirname, '..', 'assets.json' ), JSON.stringify( assets, null, '\t' ) ); files = assets.map( function( chunk ) { return path.join( process.cwd(), 'public', chunk.file );