Vue Cli Project Enable Optional Chaining

November 29, 2019

NOTE: You might want to upgrade to latest plugins

Optional Chaining: item?.name.

via Babel


npm install --save-dev @babel/plugin-proposal-optional-chaining

Edit babel.config.ts to add @babel/plugin-proposal-optional-chaining in plugins

module.exports = {
  presets: [
  plugins: [

via TypeScript

npm install typescript@latest

NOTE: Need at least version 3.7.2

Edit tsconfig.json: change target to es2020.

  "compilerOptions": {
    // "target": "esnext",
    "target": "es2020",


This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.