title: TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'
body: <p>When <code>Jest.js</code> encounters <code>import.meta</code> in the code, I get an error:</p>
  <pre><code>FAIL  testFile.test.ts
    ● Test suite failed to run
  
      testFile.ts:40:10 - error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.
  
      40          return import.meta?.env as EnvironmentalVariablesType
  </code></pre>
  <p>I have installed the following babel related packages:</p>
  <pre><code>// package.json
      &quot;devDependencies&quot;: {
          &quot;@babel/core&quot;: &quot;^7.16.5&quot;,
          &quot;@babel/preset-env&quot;: &quot;^7.16.5&quot;,
          &quot;@babel/preset-typescript&quot;: &quot;^7.16.5&quot;,
          &quot;@vitejs/plugin-react-refresh&quot;: &quot;1.3.6&quot;,
          &quot;babel-jest&quot;: &quot;^27.4.5&quot;,
          &quot;jest&quot;: &quot;27.3.1&quot;,
          &quot;jest-environment-jsdom-global&quot;: &quot;3.0.0&quot;,
          &quot;react&quot;: &quot;17.0.1&quot;,
          &quot;ts-jest&quot;: &quot;27.0.7&quot;,
          &quot;typescript&quot;: &quot;4.1.3&quot;,
          &quot;vite&quot;: &quot;2.6.14&quot;
      &quot;dependencies&quot;: {
          &quot;babel-plugin-transform-vite-meta-env&quot;: &quot;^1.0.3&quot;,
          &quot;babel-preset-vite&quot;: &quot;^1.0.4&quot;,
  </code></pre>
  <p>I've setup <code>babel.config.js</code> as follows:</p>
  <pre><code>module.exports = {
      plugins: [ 'babel-plugin-transform-vite-meta-env' ],
      presets: [
          [
              '@babel/preset-env',
              { targets: { node: 'current' } },
          ],
          [ '@babel/preset-typescript' ],
          [ 'babel-preset-vite' ],
      ],
  }
  
  </code></pre>
  <p>and my <code>vite.config.js</code>:</p>
  <pre><code>import { defineConfig } from 'vite'
  import reactRefresh from '@vitejs/plugin-react-refresh'
  import replace from '@rollup/plugin-replace'
  
  // https://vitejs.dev/config/
  export default defineConfig( {
      base: '/time/',
      server: {
          port: 9000,
      },
      plugins: [
          reactRefresh(),
          replace( {
              'process.env.NODE_ENV': JSON.stringify( 'development' ),
              'process.env.SHOW_DEV_TOOLS': JSON.stringify( 'true' ),
          } ),
      ],
  } )
  </code></pre>
  <p><strong>Tried</strong></p>
  <ul>
  <li>set <code>module</code> in tsconfig.json to <code>es2020</code>, <code>esnext</code>, or <code>system</code></li>
  </ul>
  <p>None of these cleared or changed the terminal error.</p>
  <p>Is there some misconfiguration above that is preventing Jest from properly running babel?</p>