File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
packages/app/src/sandbox/eval Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,14 @@ export default function initialize() {
4444 'babel-plugin-macros' ,
4545 [ 'proposal-class-properties' , { loose : true } ] ,
4646 [ 'proposal-object-rest-spread' , { useBuiltIns : true } ] ,
47- 'transform-runtime' ,
47+ [
48+ 'transform-runtime' ,
49+ {
50+ corejs : false ,
51+ helpers : true ,
52+ regenerator : true ,
53+ } ,
54+ ] ,
4855 'syntax-dynamic-import' ,
4956 ] ,
5057 presets : [
Original file line number Diff line number Diff line change 11import isESModule from '../../utils/is-es-module' ;
22
33const JSXSyntax = / \n ( .* ?) < [ A - z ] ( .| \n ) * ?\/ ? > / ;
4+ const regeneratorSyntax = / ( \s | ^ ) r e g e n e r a t o r R u n t i m e \. / ;
45
56export function shouldTranspile ( code : string , path : string ) {
67 if ( isESModule ( code ) ) {
78 return true ;
89 }
910
11+ if ( regeneratorSyntax . test ( code ) ) {
12+ return true ;
13+ }
14+
1015 const match = code . match ( JSXSyntax ) ;
1116 if ( match ) {
1217 const startOfLine = match [ 1 ] ;
You can’t perform that action at this time.
0 commit comments