title: Loading babel.config error with Svelte + Vite app
body: <p>I'm building a new app with Svelte and Vite and I would like to use a jest test with it. I configured it as usual but I have this information about an error:</p>
  <pre><code>tests/App.spec.js
    ● Test suite failed to run
  
      /Users/ewakadziolka/Desktop/svelte/aloes/babel.config.js: Error while loading config - You appear to be using a native ECMAScript module configuration file, which is only supported when running Babel asynchronously.
  
        at loadCjsOrMjsDefault (node_modules/@babel/core/lib/config/files/module-types.js:82:13)
            at loadCjsOrMjsDefault.next (&lt;anonymous&gt;)
        at readConfigJS (node_modules/@babel/core/lib/config/files/configuration.js:215:47)
            at readConfigJS.next (&lt;anonymous&gt;)
        at Function.&lt;anonymous&gt; (node_modules/@babel/core/lib/gensync-utils/async.js:27:3)
        at evaluateSync (node_modules/gensync/index.js:251:28)
        at Function.sync (node_modules/gensync/index.js:89:14)
        at sync (node_modules/@babel/core/lib/gensync-utils/async.js:78:25)
        at sync (node_modules/gensync/index.js:182:19)
  
  Test Suites: 1 failed, 1 total
  Tests:       0 total
  Snapshots:   0 total
  Time:        2.681 s
  Ran all test suites related to changed files.
  
  Watch Usage: Press w to show more.
  </code></pre>
  <p>An App. svelte for a moment is very easy:</p>
  <pre><code>&lt;main&gt;
    &lt;h1&gt;Hello word!&lt;/h1&gt;
  &lt;/main&gt;
  </code></pre>
  <p>my babel.congig.js is like this:</p>
  <pre><code>module.exports = { presets: [[&quot;@babel/preset-env&quot;, { targets: { node: &quot;current&quot; } }]],  
  };
  </code></pre>
  <p>and my package.json like this:</p>
  <pre><code>{
    &quot;name&quot;: &quot;aloes&quot;,
    &quot;private&quot;: true,
    &quot;version&quot;: &quot;0.0.0&quot;,
    &quot;type&quot;: &quot;module&quot;,
    &quot;scripts&quot;: {
      &quot;dev&quot;: &quot;vite&quot;,
      &quot;build&quot;: &quot;vite build&quot;,
      &quot;preview&quot;: &quot;vite preview&quot;,
      &quot;test&quot;: &quot;jest --watch&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;@babel/preset-env&quot;: &quot;^7.18.9&quot;,
      &quot;@sveltejs/vite-plugin-svelte&quot;: &quot;^1.0.1&quot;,
      &quot;@testing-library/dom&quot;: &quot;^8.16.0&quot;,
      &quot;@testing-library/svelte&quot;: &quot;^3.1.3&quot;,
      &quot;@testing-library/user-event&quot;: &quot;^14.2.6&quot;,
      &quot;babel-jest&quot;: &quot;^28.1.3&quot;,
      &quot;jest&quot;: &quot;^28.1.3&quot;,
      &quot;jest-environment-jsdom&quot;: &quot;^28.1.3&quot;,
      &quot;svelte&quot;: &quot;^3.49.0&quot;,
      &quot;svelte-jester&quot;: &quot;^2.3.2&quot;,
      &quot;vite&quot;: &quot;^3.0.0&quot;
    },
    &quot;jest&quot;: {
      &quot;transform&quot;: {
        &quot;^.+\\.svelte$&quot;: &quot;svelte-jester&quot;,
        &quot;^.+\\.js$&quot;: &quot;babel-jest&quot;
      },
      &quot;testEnvironment&quot;: &quot;jsdom&quot;
    }
  }
  </code></pre>
  <p>This configuration worked very well when I used rollup to build an app.</p>