Skip to content

Commit d5f5f60

Browse files
Ives van HoorneIves van Hoorne
authored andcommitted
Support POC for classy
1 parent 018f5d1 commit d5f5f60

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

packages/app/src/sandbox/eval/transpilers/babel/worker/babel-worker.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ async function initializeBrowserFS() {
110110
}
111111
fsLoading = false;
112112
fsInitialized = true;
113+
114+
// Write the empty file that we use for native modules.
115+
BrowserFS.BFSRequire('fs').writeFileSync(
116+
'/empty.js',
117+
`module.exports = {}`
118+
);
119+
113120
resolve();
114121
// BrowserFS is initialized and ready-to-use!
115122
}

packages/app/src/sandbox/eval/transpilers/babel/worker/evaluate.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,22 @@ export default function evaluate(
4848
return {};
4949
}
5050

51+
if (requirePath === 'os') {
52+
return {};
53+
}
54+
55+
if (requirePath === 'http') {
56+
return {};
57+
}
58+
59+
if (requirePath === 'https') {
60+
return {};
61+
}
62+
63+
if (requirePath === 'url') {
64+
return {};
65+
}
66+
5167
if (requirePath === 'constants') {
5268
return {};
5369
}

0 commit comments

Comments
 (0)