rollup打包报错“semantic error TS2802”

rollup版本:2.79.1;nodejs:16.16.0;typescript:5.1.6

错误信息

javascript 复制代码
Error: D:/**/*.ts(158,32): semantic error TS2802: Type 'StyleSheetList' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.

修改tsconfig.json配置,增加"lib": ["es2015"]配置

javascript 复制代码
{
  "files": [],
  "references": [
    {
      "path": "./tsconfig.node.json"
    },
    {
      "path": "./tsconfig.app.json"
    },
    {
      "path": "./tsconfig.vitest.json"
    }
  ],
  "compilerOptions": {
    "downlevelIteration": true,
    "lib": ["es2015"],
  }
}

源代码可参考:vue3-print-ts (gitee.com)

相关推荐
蓝莓味的口香糖1 小时前
【vue】初始化 Vue 项目
前端·javascript·vue.js
aikongmeng1 小时前
【Ai】Claude Code 初始化引导
javascript
光影少年1 小时前
数组去重方法
开发语言·前端·javascript
我命由我123451 小时前
浏览器的 JS 模块化支持观察记录
开发语言·前端·javascript·css·html·ecmascript·html5
weixin_443478512 小时前
Flutter第三方常用组件包之路由管理
前端·javascript·flutter
武藤一雄2 小时前
C# 异步回调与等待机制
前端·microsoft·设计模式·微软·c#·.netcore
啥都不懂的小小白2 小时前
前端CSS入门详解
前端·css
林恒smileZAZ3 小时前
前端大屏适配方案:rem、vw/vh、scale 到底选哪个?
开发语言·前端·css·css3
QQ5110082853 小时前
基于区块链的个人医疗咨询挂号信息系统vue
前端·vue.js·区块链
程序员小寒5 小时前
JavaScript设计模式(八):命令模式实现与应用
前端·javascript·设计模式·ecmascript·命令模式