Skip to content

Commit

Permalink
build web worker in dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley committed Oct 1, 2021
1 parent 6e2b29e commit 9e8b10d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 1 addition & 2 deletions scripts/build-atomics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ function buildAtomicsDebug(opts: BuildOptions): RollupOptions {
for (const f in bundle) {
const b = bundle[f];
if (b.type === 'chunk') {
const jsCode = b.code;
const debugJsPath = join(opts.distLibDebugDir, 'partytown-sandbox-atomics.js');
await writeFile(debugJsPath, jsCode);
await writeFile(debugJsPath, b.code);
b.code = debugHtml;
}
}
Expand Down
7 changes: 7 additions & 0 deletions scripts/build-web-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,12 @@ export function webWorkerBlobUrlPlugin(
}
return null;
},
async generateBundle() {
if (opts.isDev) {
const wwCode = await buildWebWorker(opts, msgType, debug);
const wwDebugFilePath = join(opts.distLibDebugDir, `partytown-ww-${msgType}.js`);
await writeFile(wwDebugFilePath, wwCode);
}
},
};
}

1 comment on commit 9e8b10d

@vercel
Copy link

@vercel vercel bot commented on 9e8b10d Oct 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.