vue-template-babel-compiler

Post compiler for Vue template render functions to support ES features with Babel
1,501,606 121
Install
npm install vue-template-babel-compiler
Latest Version:2.0.0
Vue:2
License:MIT
Last Updated:Mar 25, 2023
Links: GitHub  ·  npm
Maintainer: juniortour

vue-template-babel-compiler · Maintenance PRs Welcome

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

DEMO

DEMO

Features

Usage

1. Install

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

2. Config

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

Related Packages

j-vue

.vue single-file component back-end compiler. Belong to "Plan J"./.vue 单文件组...

6,068 7
@vue/cli-plugin-babel

babel plugin for vue-cli

25,733,760 29,510
babel-helper-vue-jsx-merge-props

babel helper for vue jsx spread.

13,911,770 31
babel-plugin-transform-vue-jsx

Babel plugin for Vue 2.0 JSX

5,479,185 1,847
@vue/component-compiler

bundler agnostic API for compiling Vue SFC

3,126,609 343

Version History

Version Released License
2.0.0 MIT
1.2.0 MIT
1.1.3 MIT
1.1.2 MIT
1.1.1 MIT
Pre-releases (10)
Version Released License
1.0.9-beta-0 MIT
1.0.7-beta.0 MIT
1.0.6-0 MIT
1.0.0-1 MIT
1.0.0-0 MIT