Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Akatuoro committed Apr 27, 2024
1 parent f9f6dc9 commit af2a9e9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
},
"devDependencies": {
"@sveltejs/adapter-auto": "^3.2.0",
"@sveltejs/adapter-static": "^3.0.1",
"@sveltejs/kit": "^2.5.7",
"@sveltejs/vite-plugin-svelte": "^3.1.0",
"@tensorflow/tfjs": "^4.18.0",
Expand Down
8 changes: 5 additions & 3 deletions src/exploration/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { getBrowserSupport } from '$lib/browser-support';
import { Exploration } from './exploration';
import workerURL from './worker?url';
import * as Comlink from 'comlink'
// window.Comlink = Comlink


let _useWorker
Expand Down Expand Up @@ -30,7 +28,11 @@ export const useWorker = () => {
export const explore = async () => {
if (useWorker()) {
console.info('using worker')
const exploration = Comlink.wrap(new Worker(workerURL, {type: 'module'}))
const worker = new Worker(new URL('./worker.js', import.meta.url), {
type: 'module'
})
const exploration = Comlink.wrap(worker)

return exploration
}
else {
Expand Down
6 changes: 4 additions & 2 deletions svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import adapter from '@sveltejs/adapter-auto';
import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';

/** @type {import('@sveltejs/kit').Config} */
Expand All @@ -8,7 +8,9 @@ const config = {
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
adapter: adapter()
adapter: adapter({
fallback: 'index.html'
})
}
};

Expand Down

0 comments on commit af2a9e9

Please sign in to comment.