Skip to content

Commit 79dfae1

Browse files
committed
Fix @babel/runtime dependency issues
1 parent 9ff465e commit 79dfae1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/app/src/sandbox/eval/transpiled-module.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,8 @@ export default class TranspiledModule {
401401
},
402402
addDependency: (depPath: string, options = {}) => {
403403
if (
404-
depPath.startsWith('@babel/runtime/') ||
404+
(!this.module.path.startsWith('/node_modules') &&
405+
depPath.startsWith('@babel/runtime/')) ||
405406
depPath.startsWith('codesandbox-api')
406407
) {
407408
return;
@@ -836,7 +837,8 @@ export default class TranspiledModule {
836837
// So it must be a dependency
837838
if (
838839
path.startsWith('codesandbox-api') ||
839-
path.startsWith('@babel/runtime/')
840+
(!transpiledModule.module.path.startsWith('/node_modules') &&
841+
path.startsWith('@babel/runtime/'))
840842
) {
841843
return resolveDependency(path, manager.externals);
842844
}

0 commit comments

Comments
 (0)