【发布时间】:2022-01-13 19:07:29
【问题描述】:
我已配置我的项目以避免构建生成的 ES5 包。为此,我将 .browserlists 和 tsconfig.json 文件配置如下:
.browserslist 文件
last 1 Chrome version
tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"module": "es2020",
"moduleResolution": "node",
"importHelpers": true,
"target": "es2017",
"typeRoots": ["node_modules/@types"],
"types": ["jest", "node"],
"lib": ["es2018", "dom", "es2020.string"],
"skipLibCheck": true
},
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableIvy": true
}
}
但它仍在生成 ES5 包...
【问题讨论】:
-
我希望,但事实并非如此......我使用 npx browserslist 命令得到了正确的结果,而且,当使用 browserlist 包而不是文件时,包仍然存在。
标签: angular angular-cli yarnpkg ng-build