JuniorTour / vue-template-babel-compiler

Enable Optional Chaining(?.), Nullish Coalescing(??) and many new ES syntax for Vue.js SFC based on Babel

Home Page:https://www.npmjs.com/package/vue-template-babel-compiler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vue-template-babel-compiler · Maintenance PRs Welcome

Enable Optional Chaining(?.), Nullish Coalescing(??) and many new ES syntax for Vue.js SFC based on Babel.

Downloads Size Version LastCommit CIStatus

DEMO

Visit Online Playground →

DEMO

Features

Usage

1. Install

npm install vue-template-babel-compiler --save-dev

2. Config

Vue-CLI Online Example Project
// vue.config.js
module.exports = {
  chainWebpack: config => {
    config.module
      .rule('vue')
      .use('vue-loader')
      .tap(options => {
        options.compiler = require('vue-template-babel-compiler')
        return options
      })
  }
}
Nuxt.js Online Example Project
// nuxt.config.js
export default {
  // Build Configuration: https://go.nuxtjs.dev/config-build
  build: {
    loaders: {
      vue: {
        compiler: require('vue-template-babel-compiler')
      }
    },
  },
  // ...
}

Welcome for Issues && PR, see CONTRIBUTING.md for detail.

About

Enable Optional Chaining(?.), Nullish Coalescing(??) and many new ES syntax for Vue.js SFC based on Babel

https://www.npmjs.com/package/vue-template-babel-compiler


Languages

Language:JavaScript 100.0%