File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
packages/app/src/sandbox/eval/transpilers/babel Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 11import isESModule from '../../utils/is-es-module' ;
22
3- const JSXSyntax = / ( .* ) < \w ( .| \n ) * ?\/ ? > / ;
3+ const JSXSyntax = / \n ( .* ? ) < \w ( .| \n ) * ?\/ ? > / ;
44
55export function shouldTranspile ( code : string , path : string ) {
66 if ( isESModule ( code ) ) {
Original file line number Diff line number Diff line change @@ -2,13 +2,15 @@ import { shouldTranspile } from './check';
22
33describe ( 'shouldTranspile' , ( ) => {
44 it ( 'does have to transpile clear jsx' , ( ) => {
5- const code = '<div></div>' ;
5+ const code = `
6+ <div></div>` ;
67
78 expect ( shouldTranspile ( code , '' ) ) . toBe ( true ) ;
89 } ) ;
910
1011 it ( "doesn't have to transpile comments with jsx" , ( ) => {
11- const code = ' // Setting .type throws on non-<input> tags' ;
12+ const code = `
13+ // Setting .type throws on non-<input> tags` ;
1214
1315 expect ( shouldTranspile ( code , '' ) ) . toBe ( false ) ;
1416 } ) ;
You can’t perform that action at this time.
0 commit comments