diff --git a/.circleci/config.yml b/.circleci/config.yml index 20586d329..2d4ee5c2b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -231,7 +231,6 @@ jobs: name: 'Build Demo Site, Upload SourceMaps, Send Deploy Notification' command: | npx lerna run build:viewer:demo --stream - # perl -i -pe 's##`cat .circleci/rollbar.html` #e' build/index.html # export FILE_1=$(find ./build/static/js -type f -name "2.*.js" -exec basename {} \;) # export FILE_MAIN=$(find ./build/static/js -type f -name "main.*.js" -exec basename {} \;) # export FILE_RUNTIME_MAIN=$(find ./build/static/js -type f -name "runtime~main.*.js" -exec basename {} \;) @@ -254,18 +253,15 @@ jobs: - setup_remote_docker: docker_layer_caching: true - run: - name: Node Test - command: npx lerna run build:viewer:demo --stream - # - run: - # name: Deploy latest version to viewer.ohif.org - # command: | - # # https://circleci.com/docs/2.0/google-auth/#authorization - # echo $GCLOUD_SERVICE_KEY | gcloud auth activate-service-account --key-file=- - # gcloud --quiet config set project ${GOOGLE_PROJECT_ID} - # gcloud --quiet config set compute/zone ${GOOGLE_COMPUTE_ZONE} - # # Remove all files in Storage Bucket; Push latest - # gsutil -m rm gs://$GOOGLE_STORAGE_BUCKET/** - # gsutil -m rsync -R platform/viewer/dist gs://$GOOGLE_STORAGE_BUCKET + name: Deploy latest version to viewer.ohif.org + command: | + # https://circleci.com/docs/2.0/google-auth/#authorization + echo $GCLOUD_SERVICE_KEY | gcloud auth activate-service-account --key-file=- + gcloud --quiet config set project ${GOOGLE_PROJECT_ID} + gcloud --quiet config set compute/zone ${GOOGLE_COMPUTE_ZONE} + # Remove all files in Storage Bucket; Push latest + gsutil -m rm gs://$GOOGLE_STORAGE_BUCKET/** + gsutil -m rsync -R platform/viewer/dist gs://$GOOGLE_STORAGE_BUCKET workflows: version: 2 diff --git a/platform/viewer/.webpack/pwa.prod.js b/platform/viewer/.webpack/pwa.prod.js index 343b6c067..82c014ee4 100644 --- a/platform/viewer/.webpack/pwa.prod.js +++ b/platform/viewer/.webpack/pwa.prod.js @@ -23,6 +23,8 @@ module.exports = (env, argv) => { return merge(commonConfig, { // https://webpack.js.org/configuration/mode/#mode-production mode: 'production', + // Out of memory -- Code Split + // devtool: 'source-map', stats: { colors: true, hash: true, @@ -47,7 +49,12 @@ module.exports = (env, argv) => { // merging with this? plugins: [ // Longer build. Let's report progress - new webpack.ProgressPlugin(), + new webpack.ProgressPlugin({ + entries: false, + modules: false, + modulesCount: 500, + profile: true, + }), // Clean output.path new CleanWebpackPlugin(), // "Public" Folder @@ -57,7 +64,13 @@ module.exports = (env, argv) => { to: DIST_DIR, toType: 'dir', // Ignore our HtmlWebpackPlugin template file - ignore: ['index.html', 'html-templates/*', '.DS_Store'], + // Ignore our configuration files + ignore: ['config/*', 'html-templates/*', '.DS_Store'], + }, + // Copy over and rename our target app config file + { + from: `${PUBLIC_DIR}/${APP_CONFIG}`, + to: `${DIST_DIR}/app-config.js`, }, ]), new ExtractCssChunksPlugin({ @@ -74,7 +87,6 @@ module.exports = (env, argv) => { filename: 'index.html', templateParameters: { PUBLIC_URL: PUBLIC_URL, - APP_CONFIG: APP_CONFIG, }, // favicon: `${PUBLIC_DIR}/favicon.ico`, }), diff --git a/platform/viewer/public/html-templates/index.html b/platform/viewer/public/html-templates/index.html index 292a19dbe..9d6776d25 100644 --- a/platform/viewer/public/html-templates/index.html +++ b/platform/viewer/public/html-templates/index.html @@ -8,11 +8,8 @@ /> - - + +