title: Vscode Extension API: Cannot find module '@babel/preset-react'
body: <p>I want to compile JSX files using '@babel/preset-react on VScode extension API. While doing this I faced an error just like below. I have tried a few ways to install but still can't get any results. It works on a basic node application but it doesn't work on VScode extension API.</p>
  <pre><code>Error: Cannot find module '@babel/preset-react'
      at webpackEmptyContext (c:\Users\PC\Desktop\type-svg\jsx-svg\dist\extension.js:56404:10)
      at resolveStandardizedName (c:\Users\PC\Desktop\type-svg\jsx-svg\dist\extension.js:57964:7)
      at resolvePreset (c:\Users\PC\Desktop\type-svg\jsx-svg\dist\extension.js:57912:10)
  js:120:14)
  c:\Users\PC\AppData\Local\Programs\Microsoft VS C
  </code></pre>
  <p>code blocks:</p>
  <pre class="lang-js prettyprint-override"><code>       try {
              let output = babel.transformSync(&quot;code&quot;, {
                  &quot;presets&quot;: [&quot;@babel/preset-react&quot;]
              });
              console.log(output)
          } catch (e) {
              console.log(e)
          }
  </code></pre>
  <p>package.json file:</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;name&quot;: &quot;jsx-svg&quot;,
      &quot;displayName&quot;: &quot;&quot;,
      &quot;description&quot;: &quot;jsx-svg&quot;,
      &quot;version&quot;: &quot;0.0.1&quot;,
      &quot;engines&quot;: {
          &quot;vscode&quot;: &quot;^1.55.0&quot;
      },
      &quot;categories&quot;: [
          &quot;Other&quot;
      ],
      &quot;activationEvents&quot;: [
          &quot;onCommand:jsx-svg.helloWorld&quot;
      ],
      &quot;main&quot;: &quot;./dist/extension.js&quot;,
      &quot;contributes&quot;: {
          &quot;commands&quot;: [
              {
                  &quot;command&quot;: &quot;jsx-svg.helloWorld&quot;,
                  &quot;title&quot;: &quot;Hello World&quot;
              }
          ]
      },
      &quot;scripts&quot;: {
          &quot;vscode:prepublish&quot;: &quot;yarn run package&quot;,
          &quot;compile&quot;: &quot;webpack&quot;,
          &quot;watch&quot;: &quot;webpack --watch&quot;,
          &quot;package&quot;: &quot;webpack --mode production --devtool hidden-source-map&quot;,
          &quot;test-compile&quot;: &quot;tsc -p ./&quot;,
          &quot;test-watch&quot;: &quot;tsc -watch -p ./&quot;,
          &quot;pretest&quot;: &quot;yarn run test-compile &amp;&amp; yarn run lint&quot;,
          &quot;lint&quot;: &quot;eslint src --ext ts&quot;,
          &quot;test&quot;: &quot;node ./out/test/runTest.js&quot;
      },
      &quot;devDependencies&quot;: {
          &quot;@babel/core&quot;: &quot;^7.14.0&quot;,
          &quot;@babel/plugin-syntax-jsx&quot;: &quot;^7.12.13&quot;,
          &quot;@babel/plugin-transform-react-jsx&quot;: &quot;^7.13.12&quot;,
          &quot;@babel/preset-react&quot;: &quot;^7.13.13&quot;,
          &quot;@babel/template&quot;: &quot;^7.12.13&quot;,
          &quot;@babel/traverse&quot;: &quot;^7.14.0&quot;,
          &quot;@types/glob&quot;: &quot;^7.1.3&quot;,
          &quot;@types/mocha&quot;: &quot;^8.0.4&quot;,
          &quot;@types/node&quot;: &quot;^12.11.7&quot;,
          &quot;@types/vscode&quot;: &quot;^1.55.0&quot;,
          &quot;@typescript-eslint/eslint-plugin&quot;: &quot;^4.14.1&quot;,
          &quot;@typescript-eslint/parser&quot;: &quot;^4.14.1&quot;,
          &quot;eslint&quot;: &quot;^7.19.0&quot;,
          &quot;glob&quot;: &quot;^7.1.6&quot;,
          &quot;mocha&quot;: &quot;^8.2.1&quot;,
          &quot;ts-loader&quot;: &quot;^8.0.14&quot;,
          &quot;typescript&quot;: &quot;^4.1.3&quot;,
          &quot;vscode-test&quot;: &quot;^1.5.0&quot;,
          &quot;webpack&quot;: &quot;^5.19.0&quot;,
          &quot;webpack-cli&quot;: &quot;^4.4.0&quot;
      },
      &quot;dependencies&quot;: {
          &quot;@types/babel__core&quot;: &quot;^7.1.14&quot;
      }
  }
  
  </code></pre>