@@ -65,7 +65,7 @@ self.require = path => {
6565 return module ;
6666 }
6767
68- if ( IGNORED_MODULES . includes ( path ) ) {
68+ if ( IGNORED_MODULES . indexOf ( path ) > - 1 ) {
6969 return { } ;
7070 }
7171
@@ -340,13 +340,13 @@ async function compile(code, customConfig, path, isV7) {
340340 } catch ( e ) {
341341 if (
342342 ! fsInitialized &&
343- ( e . message . includes ( 'Cannot find module' ) || e . code === 'EIO' )
343+ ( e . message . indexOf ( 'Cannot find module' ) > - 1 || e . code === 'EIO' )
344344 ) {
345345 // BrowserFS was needed but wasn't initialized
346346 await waitForFs ( ) ;
347347
348348 await compile ( code , customConfig , path ) ;
349- } else if ( e . message . includes ( 'Cannot find module' ) ) {
349+ } else if ( e . message . indexOf ( 'Cannot find module' ) > - 1 ) {
350350 // Try to download the file and all dependencies, retry compilation then
351351 await downloadFromError ( e ) . then ( ( ) => {
352352 resetCache ( ) ;
@@ -504,19 +504,19 @@ self.addEventListener('message', async event => {
504504
505505 if ( ! disableCodeSandboxPlugins ) {
506506 if (
507- flattenedPresets . includes ( 'env' ) &&
508- ! Object . keys ( Babel . availablePresets ) . includes ( 'env' ) &&
507+ flattenedPresets . indexOf ( 'env' ) > - 1 &&
508+ Object . keys ( Babel . availablePresets ) . indexOf ( 'env' ) === - 1 &&
509509 version !== 7
510510 ) {
511511 Babel . registerPreset ( 'env' , Babel . availablePresets . latest ) ;
512512 }
513513
514514 if (
515515 version === 7 &&
516- ! Object . keys ( Babel . availablePresets ) . includes ( 'env' ) &&
517- ( flattenedPresets . includes ( 'env' ) ||
518- flattenedPresets . includes ( '@babel/preset-env' ) ||
519- flattenedPresets . includes ( '@vue/app' ) )
516+ Object . keys ( Babel . availablePresets ) . indexOf ( 'env' ) === - 1 &&
517+ ( flattenedPresets . indexOf ( 'env' ) > - 1 ||
518+ flattenedPresets . indexOf ( '@babel/preset-env' ) > - 1 ||
519+ flattenedPresets . indexOf ( '@vue/app' ) > - 1 )
520520 ) {
521521 const envPreset = await import (
522522 /* webpackChunkName: 'babel-preset-env' */ '@babel/preset-env'
@@ -525,8 +525,8 @@ self.addEventListener('message', async event => {
525525 }
526526
527527 if (
528- flattenedPlugins . includes ( 'transform-vue-jsx' ) &&
529- ! Object . keys ( Babel . availablePlugins ) . includes ( 'transform-vue-jsx' )
528+ flattenedPlugins . indexOf ( 'transform-vue-jsx' ) > - 1 &&
529+ Object . keys ( Babel . availablePlugins ) . indexOf ( 'transform-vue-jsx' ) === - 1
530530 ) {
531531 const vuePlugin = await import (
532532 /* webpackChunkName: 'babel-plugin-transform-vue-jsx' */ 'babel-plugin-transform-vue-jsx'
@@ -535,8 +535,8 @@ self.addEventListener('message', async event => {
535535 }
536536
537537 if (
538- flattenedPlugins . includes ( 'jsx-pragmatic' ) &&
539- ! Object . keys ( Babel . availablePlugins ) . includes ( 'jsx-pragmatic' )
538+ flattenedPlugins . indexOf ( 'jsx-pragmatic' ) > - 1 &&
539+ Object . keys ( Babel . availablePlugins ) . indexOf ( 'jsx-pragmatic' ) === - 1
540540 ) {
541541 const pragmaticPlugin = await import (
542542 /* webpackChunkName: 'babel-plugin-jsx-pragmatic' */ 'babel-plugin-jsx-pragmatic'
@@ -545,8 +545,8 @@ self.addEventListener('message', async event => {
545545 }
546546
547547 if (
548- flattenedPlugins . includes ( 'babel-plugin-macros' ) &&
549- ! Object . keys ( Babel . availablePlugins ) . includes ( 'babel-plugin-macros' )
548+ flattenedPlugins . indexOf ( 'babel-plugin-macros' ) > - 1 &&
549+ Object . keys ( Babel . availablePlugins ) . indexOf ( 'babel-plugin-macros' ) === - 1
550550 ) {
551551 if ( hasMacros ) {
552552 await waitForFs ( ) ;
@@ -556,8 +556,8 @@ self.addEventListener('message', async event => {
556556 }
557557
558558 if (
559- flattenedPlugins . includes ( 'transform-cx-jsx' ) &&
560- ! Object . keys ( Babel . availablePlugins ) . includes ( 'transform-cx-jsx' )
559+ flattenedPlugins . indexOf ( 'transform-cx-jsx' ) > - 1 &&
560+ Object . keys ( Babel . availablePlugins ) . indexOf ( 'transform-cx-jsx' ) === - 1
561561 ) {
562562 const cxJsxPlugin = await import (
563563 /* webpackChunkName: 'transform-cx-jsx' */ 'babel-plugin-transform-cx-jsx'
0 commit comments