vue-template-babel-compiler

2.0.0 • Public • Published

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

1. Vue-CLI

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
      })
  }
}

2. Nuxt.js

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')
      }
    },
  },
  // ...
}

Doc

API Doc

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

Package Sidebar

Install

npm i vue-template-babel-compiler

Weekly Downloads

41,064

Version

2.0.0

License

MIT

Unpacked Size

14.2 kB

Total Files

3

Last publish

Collaborators

  • juniortour