title: @babel/plugin-proposal-optional-chaining not working inside Vue.js <script> tag
body: <p>In the vue/vuetify project, while trying to get optional chaining (<a href="https://babeljs.io/docs/en/babel-plugin-proposal-optional-chaining" rel="noreferrer">https://babeljs.io/docs/en/babel-plugin-proposal-optional-chaining</a>) to work, I always encounter an error:</p>
  <pre><code>
  ./src/App.vue?vue&amp;type=script&amp;lang=ts&amp; (./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&amp;type=script&amp;lang=ts&amp;) 155:24
  Module parse failed: Unexpected token (155:24)
  File was processed with these loaders:
   * ./node_modules/cache-loader/dist/cjs.js
   * ./node_modules/vue-loader/lib/index.js
  You may need an additional loader to handle the result of these loaders.
  |         }
  | 
  &gt;         const baz = obj?.foo?.bar?.baz // 42
  | 
  |         const safe = obj?.qux?.baz // undefined
  </code></pre>
  <p>I have added <code>@babel/plugin-proposal-optional-chaining</code> using the <code>yarn add @babel/plugin-proposal-optional-chaining --dev</code> command</p>
  <p>In my
  <strong>App.vue</strong> I have this code, at <em>created()</em>:</p>
  <pre><code>const obj = {
    foo: {
      bar: {
        baz: 42,
      },
    },
  }
  
  const baz = obj?.foo?.bar?.baz // 42
  const safe = obj?.qux?.baz // undefined
  
  console.log({ baz, safe })
  </code></pre>
  <p>My babel.config.js looks like this:</p>
  <pre><code>module.exports = {
      presets: [
          [
              &quot;@babel/preset-env&quot;,
              {
                  targets: {
                      node: &quot;current&quot;,
                  },
              },
          ],
      ],
      plugins: [&quot;@babel/plugin-proposal-optional-chaining&quot;],
  }
  </code></pre>
  <p>I'm using vue v.2.6.9.</p>
  <p>Seems like after that setup everything should work just fine, the only similar issue I have found is this one: <a href="https://github.com/vuejs/vue-loader/issues/1697" rel="noreferrer">https://github.com/vuejs/vue-loader/issues/1697</a>, but here I am, actually using the Babel and not using TypeScript.</p>