Skip to content

Commit

Permalink
fix(createWebWorkerPromise): Move up one directory
Browse files Browse the repository at this point in the history
This results in:

-    worker = new Worker(new URL('../../web-workers/pipeline.worker.js', import.meta.url))
+    worker = new Worker(new URL('../web-workers/pipeline.worker.js', import.meta.url))

which helps the use case:

1) bundle with rollup
2) bundle the resulting bundle with vite
  • Loading branch information
thewtex committed Jan 16, 2023
1 parent 6a4d98d commit 1ed0b88
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from 'axios'
import WebworkerPromise from 'webworker-promise'

import config from '../../itkConfig.js'
import config from '../itkConfig.js'

interface createWebWorkerPromiseResult {
webworkerPromise: typeof WebworkerPromise
Expand Down Expand Up @@ -52,7 +52,7 @@ async function createWebWorkerPromise (existingWorker: Worker | null): Promise<c
// importScripts / UMD is required over dynamic ESM import until Firefox
// adds worker dynamic import support:
// https://bugzilla.mozilla.org/show_bug.cgi?id=1540913
worker = new Worker(new URL('../../web-workers/pipeline.worker.js', import.meta.url))
worker = new Worker(new URL('../web-workers/pipeline.worker.js', import.meta.url))
} else {
const pipelineWorkerUrl = config.pipelineWorkerUrl
if (pipelineWorkerUrl.startsWith('http')) {
Expand Down
2 changes: 1 addition & 1 deletion src/io/meshToPolyData.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import createWebWorkerPromise from '../core/internal/createWebWorkerPromise.js'
import createWebWorkerPromise from '../core/createWebWorkerPromise.js'
import Mesh from '../core/Mesh.js'
import InterfaceTypes from '../core/InterfaceTypes.js'
import PolyData from '../core/PolyData.js'
Expand Down
2 changes: 1 addition & 1 deletion src/io/polyDataToMesh.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import createWebWorkerPromise from '../core/internal/createWebWorkerPromise.js'
import createWebWorkerPromise from '../core/createWebWorkerPromise.js'
import Mesh from '../core/Mesh.js'
import InterfaceTypes from '../core/InterfaceTypes.js'
import PolyData from '../core/PolyData.js'
Expand Down
2 changes: 1 addition & 1 deletion src/io/readDICOMTagsArrayBuffer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import createWebWorkerPromise from '../core/internal/createWebWorkerPromise.js'
import createWebWorkerPromise from '../core/createWebWorkerPromise.js'
import PipelineInput from '../pipeline/PipelineInput.js'
import TextStream from '../core/TextStream.js'

Expand Down
2 changes: 1 addition & 1 deletion src/io/readImageArrayBuffer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import createWebWorkerPromise from '../core/internal/createWebWorkerPromise.js'
import createWebWorkerPromise from '../core/createWebWorkerPromise.js'
import Image from '../core/Image.js'
import InterfaceTypes from '../core/InterfaceTypes.js'
import PipelineInput from '../pipeline/PipelineInput.js'
Expand Down
2 changes: 1 addition & 1 deletion src/io/readImageDICOMArrayBufferSeries.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import createWebWorkerPromise from '../core/internal/createWebWorkerPromise.js'
import createWebWorkerPromise from '../core/createWebWorkerPromise.js'
import WorkerPool from '../core/WorkerPool.js'
import Metadata from '../core/Metadata.js'
import stackImages from '../core/stackImages.js'
Expand Down
2 changes: 1 addition & 1 deletion src/io/readMeshArrayBuffer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import createWebWorkerPromise from '../core/internal/createWebWorkerPromise.js'
import createWebWorkerPromise from '../core/createWebWorkerPromise.js'
import Mesh from '../core/Mesh.js'
import InterfaceTypes from '../core/InterfaceTypes.js'
import PipelineInput from '../pipeline/PipelineInput.js'
Expand Down
2 changes: 1 addition & 1 deletion src/io/writeImageArrayBuffer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import createWebWorkerPromise from '../core/internal/createWebWorkerPromise.js'
import createWebWorkerPromise from '../core/createWebWorkerPromise.js'

import Image from '../core/Image.js'

Expand Down
2 changes: 1 addition & 1 deletion src/io/writeMeshArrayBuffer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import createWebWorkerPromise from '../core/internal/createWebWorkerPromise.js'
import createWebWorkerPromise from '../core/createWebWorkerPromise.js'

import Mesh from '../core/Mesh.js'

Expand Down
2 changes: 1 addition & 1 deletion src/pipeline/runPipeline.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import createWebWorkerPromise from '../core/internal/createWebWorkerPromise.js'
import createWebWorkerPromise from '../core/createWebWorkerPromise.js'
import loadEmscriptenModuleMainThread from '../core/internal/loadEmscriptenModuleMainThread.js'

import config from '../itkConfig.js'
Expand Down

0 comments on commit 1ed0b88

Please sign in to comment.