Skip to content

Commit 68d9970

Browse files
fix: prevent bundles overwriting each other (#573)
* refactor: use target (clearer intention) * fix: use contenthash to avoid name clashes This lets us keep sharing any common chunks (i.e. common to the python and js evaluators) because they're stored in the same folder, but if the chunks differ at all they become separate files. Ideally, large files (like typescript) would be shared between all three evaluators, but it's not clear how to achieve that. It may not be possible
1 parent 876ec23 commit 68d9970

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/helpers/lib/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import { strip } from "./strip";
22
import astHelpers from "../python/py_helpers.py";
33

44
export const Explorer = async (code: string) =>
5-
new (await import("./class/explorer")).Explorer(code);
5+
new (
6+
await import(/* webpackChunkName: "explorer" */ "./class/explorer")
7+
).Explorer(code);
68

79
declare global {
810
var IS_REACT_ACT_ENVIRONMENT: boolean;

webpack.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,9 @@ const testRunnerConfig =
139139
path: isDev
140140
? __dirname + "/__fixtures__/dist"
141141
: __dirname + "/dist/test-runner",
142-
...(isWorker && { chunkLoading: "import-scripts" }),
142+
chunkFilename: "[name].[contenthash].js",
143143
},
144+
target: isWorker ? "webworker" : "web",
144145
module: {
145146
rules: [
146147
{

0 commit comments

Comments
 (0)