【问题标题】:Angular 12 Differential loading continues generating ES5 bundle when disabledAngular 12 差异加载在禁用时继续生成 ES5 包
【发布时间】: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


【解决方案1】:

我通过全新的全新安装修复了它。基本上:

  1. 删除 node_modules 和 yarn.lock.json 文件。
  2. 清理纱线缓存
  3. 纱线安装

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-06-21
    • 2020-10-23
    • 1970-01-01
    • 1970-01-01
    • 2016-07-01
    • 2019-11-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多