File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
packages/app/src/sandbox/eval/loaders Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 11import DependencyNotFoundError from 'sandbox-hooks/errors/dependency-not-found-error' ;
22
3+ /**
4+ * We don't have fancy resolving for @babel/runtime because of optimalization,
5+ * so we try to alter it the best way we can.
6+ */
7+ function alterBabelRuntimeDependencyPath ( path : string ) {
8+ if ( path === '@babel/runtime/regenerator' ) {
9+ return '@babel/runtime/regenerator/index' ;
10+ }
11+
12+ return path ;
13+ }
14+
315/**
416 * Converts a dependency string to an actual dependency
517 *
@@ -10,7 +22,9 @@ import DependencyNotFoundError from 'sandbox-hooks/errors/dependency-not-found-e
1022export default function getDependency ( dependencyPath : string ) {
1123 if ( dependencyPath . startsWith ( '@babel/runtime/' ) ) {
1224 // We have a precomputed bundle for this, since it's small anyway
13- return require ( './@babel-runtime.no-webpack' ) ( dependencyPath ) ;
25+ return require ( './@babel-runtime.no-webpack' ) (
26+ alterBabelRuntimeDependencyPath ( dependencyPath )
27+ ) ;
1428 }
1529
1630 if ( dependencyPath === 'codesandbox-api' ) {
You can’t perform that action at this time.
0 commit comments