Skip to content

Commit

Permalink
fix: web worker using worker plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Jun 25, 2022
1 parent b8590f1 commit a38863a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 2 additions & 0 deletions packages/vitest/src/node/config.ts
Expand Up @@ -12,6 +12,8 @@ import { toArray } from '../utils'
const extraInlineDeps = [
/^(?!.*(?:node_modules)).*\.mjs$/,
/^(?!.*(?:node_modules)).*\.cjs\.js$/,
// Vite client
/vite\w*\/dist\/client\/env.mjs/,
// Vitest
/\/vitest\/dist\//,
// yarn's .store folder
Expand Down
6 changes: 1 addition & 5 deletions packages/web-worker/src/pure.ts
Expand Up @@ -126,11 +126,7 @@ export function defineWebWorker() {

const runner = new InlineWorkerRunner(options, context)

let id = url instanceof URL ? url.toString() : url

id = id
.replace('?worker_file', '')
.replace(/^file:\/+/, '/')
const id = (url instanceof URL ? url.toString() : url).replace(/^file:\/+/, '/')

const fsPath = toFilePath(id, config.root)
invalidates.push(fsPath)
Expand Down

0 comments on commit a38863a

Please sign in to comment.