From 686f613fd0799c323b6d6510d053c43a64b46b8f Mon Sep 17 00:00:00 2001 From: dannyrb Date: Tue, 30 Apr 2019 16:11:06 -0400 Subject: [PATCH] Use absolute path for webworker scripts --- package.json | 2 +- src/utils/initWebWorkers.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index dd2e7978c..2e98caa5c 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "dev": "yarn run preBuild && cross-env PORT=5000 react-scripts start", "dev:debug": "cross-env PORT=5000 react-scripts start", "build:package": "yarn run preBuild && node --max-old-space-size=4096 node_modules/rollup/bin/rollup -c", - "build:package:ci": "yarn run preBuild && cross-env REACT_APP_CONFIG=config/default.js node --max-old-space-size=4096 node_modules/rollup/bin/rollup -c", + "build:package:ci": "yarn run preBuild && node --max-old-space-size=4096 node_modules/rollup/bin/rollup -c", "build:web": "yarn run preBuild && react-scripts --max_old_space_size=4096 build", "build:web:ci": "yarn run preBuild && cross-env PUBLIC_URL=/demo REACT_APP_CONFIG=config/netlify.js react-scripts --max_old_space_size=4096 build && cpx 'build/**/*' docs/latest/_book/demo --verbose", "lint": "eslint -c .eslintrc --fix src && prettier --single-quote --write src/**/*.{js,jsx,json,css}", diff --git a/src/utils/initWebWorkers.js b/src/utils/initWebWorkers.js index 1de094071..26ec6ca2b 100644 --- a/src/utils/initWebWorkers.js +++ b/src/utils/initWebWorkers.js @@ -6,7 +6,9 @@ import cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader' * @param {String} webWorkScriptsPath */ export default function(baseDirectory, webWorkScriptsPath) { - const scriptsPath = `${baseDirectory}/${webWorkScriptsPath}` + const scriptsPath = `${window.location.protocol}//${ + window.location.host + }${baseDirectory}/${webWorkScriptsPath}` const config = { maxWebWorkers: Math.max(navigator.hardwareConcurrency - 1, 1), startWebWorkersOnDemand: true,