vue-template-babel-compiler

    1.0.6-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

    DEMO

    DEMO

    Features

    Usage

    1. Install

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

    2. Config

    1. Vue-CLI

    DEMO project for Vue-CLI

    // 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

    DEMO project for Nuxt.js

    // nuxt.config.js
    export default {
      // Build Configuration: https://go.nuxtjs.dev/config-build
      build: {
        loaders: {
          vue: {
            compiler: require('vue-template-babel-compiler')
          }
        },
      },
      // ...
    }

    Usage Detail Doc

    API Doc

    Welcome for Issues && PR.

    Install

    npm i vue-template-babel-compiler

    DownloadsWeekly Downloads

    1,992

    Version

    1.0.6-0

    License

    MIT

    Unpacked Size

    12.4 kB

    Total Files

    4

    Last publish

    Collaborators

    • juniortour