From 755b5cdcab0d0b2f5c218186ccd6e9f444e82fc3 Mon Sep 17 00:00:00 2001 From: ZHAO Jinxiang Date: Fri, 18 Feb 2022 15:04:09 +0800 Subject: [PATCH] feat: add vue-template-babel-compiler for optional chaining (#59) --- template/base/package.json | 13 +++++++------ template/base/vite.config.js | 7 ++++++- template/config/typescript/package.json | 4 ++-- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/template/base/package.json b/template/base/package.json index 43d63867..67c91e61 100644 --- a/template/base/package.json +++ b/template/base/package.json @@ -5,15 +5,16 @@ "preview": "vite preview --port 5050" }, "dependencies": { - "@vue/composition-api": "^1.4.0", + "@vue/composition-api": "^1.4.6", "vue": "^2.6.14" }, "devDependencies": { - "@vitejs/plugin-legacy": "^1.6.3", - "@vue/runtime-dom": "^3.2.22", - "unplugin-vue2-script-setup": "^0.7.1", - "vite": "^2.6.14", - "vite-plugin-vue2": "^1.9.0", + "@vitejs/plugin-legacy": "^1.7.1", + "@vue/runtime-dom": "^3.2.31", + "unplugin-vue2-script-setup": "^0.9.3", + "vite": "^2.8.3", + "vite-plugin-vue2": "^1.9.3", + "vue-template-babel-compiler": "1.1.3", "vue-template-compiler": "^2.6.14" } } diff --git a/template/base/vite.config.js b/template/base/vite.config.js index af324b38..42b92136 100644 --- a/template/base/vite.config.js +++ b/template/base/vite.config.js @@ -3,13 +3,18 @@ import { fileURLToPath } from 'url' import { defineConfig } from 'vite' import legacy from '@vitejs/plugin-legacy' import { createVuePlugin as vue2 } from 'vite-plugin-vue2' +// @ts-ignore +import vueTemplateBabelCompiler from 'vue-template-babel-compiler' import scriptSetup from 'unplugin-vue2-script-setup/vite' // https://vitejs.dev/config/ export default defineConfig({ plugins: [ vue2({ - jsx: true + jsx: true, + vueTemplateOptions: { + compiler: vueTemplateBabelCompiler + } }), scriptSetup(), legacy({ diff --git a/template/config/typescript/package.json b/template/config/typescript/package.json index 5e562e44..435c1cfe 100644 --- a/template/config/typescript/package.json +++ b/template/config/typescript/package.json @@ -5,7 +5,7 @@ }, "devDependencies": { "@types/node": "^16.11.10", - "typescript": "~4.5.2", - "vue-tsc": "^0.29.6" + "typescript": "~4.5.5", + "vue-tsc": "^0.31.4" } } -- 2.47.3