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)