在使用 Vue 2 和 Vue CLI 时,这个问题在几个方面让我感到困惑,现在又开始了一个新的 Vue 3.0 beta 项目。
Even with the currently newest Vue CLI version 4.3.1, when choosing TypeScript option, the boilerplate code you are given has compilerOptions target set as esnext in tsconfig.json
.
虽然Vue 2 TypeScript 指南正在指导:
# Recommended Configuration
// tsconfig.json
{
"compilerOptions": {
// this aligns with Vue's browser support
"target": "es5",
// this enables stricter inference for data properties on `this`
"strict": true,
// if using webpack 2+ or rollup, to leverage tree shaking:
"module": "es2015",
"moduleResolution": "node"
}
}
目前Vue Next repo 正在使用esnext
,虽然此时 IE11 支持尚未准备好(但无论如何可能不会影响此配置)...
使用 Vue 3 时,此编译器目标的推荐设置是什么?
我需要支持低至 IE11 的旧版浏览器,但这个特定的应用程序项目在其初始发布之前有足够的时间等待 Vue 3 的完整发布。