首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >当使用vite时,还不支持将const转换到已配置的目标环境("es5")

当使用vite时,还不支持将const转换到已配置的目标环境("es5")
EN

Stack Overflow用户
提问于 2022-08-08 11:52:30
回答 1查看 453关注 0票数 0

这是我为一个没有创建-反应应用程序而构建的app项目的tsconfig。

代码语言:javascript
复制
{
  "compilerOptions": {
    "target": "es5",
    "outDir": "lib",
    "lib": ["dom", "dom.iterable", "esnext"],
    "declaration": true,
    "declarationDir": "lib",
    "allowJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "react-jsx"
  },
  "include": ["src"],
  "exclude": ["node_modules", "lib"],
  "references": [{ "path": "./tsconfig.vite.json" }]
}

在运行命令vite时,我得到了以上错误,该命令应该是用来旋转一个dev服务器的

EN

回答 1

Stack Overflow用户

发布于 2022-08-08 11:52:30

解决方案是将es5更新为ES2015

代码语言:javascript
复制
{
...
"target":"ES2015",
...
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73277461

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档