小编Ind*_*ika的帖子

Angular Production Build 生成大量惰性块文件

我是 Angular 的新手,目前正在开发一个 Angular 应用程序,该应用程序通过 Visual Studio 创建,最近更新到最新的 Angular 版本(12)。

我的应用程序没有任何延迟加载的实现。但是当我发布应用程序时,它会生成大量名为Lazy Chunk Files的 js 文件。

我的构建输出如下。 在此输入图像描述

我的 tsconfig.json 文件如下,

在此输入图像描述

而且,我的 angular.json 文件如下,

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "Website": {
      "root": "",
      "sourceRoot": "src",
      "projectType": "application",
      "prefix": "app",
      "schematics": {},
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "progress": true,
            "outputPath": "dist",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.app.json",
            "assets": [
              "src/assets"
            ],
            "styles": [
              "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
              "node_modules/bootstrap/dist/css/bootstrap.min.css",
              "node_modules/font-awesome/css/font-awesome.min.css",
              "src/styles.css"
            ],
            "scripts": [],
            "allowedCommonJsDependencies": ["@ctrl/ngx-codemirror", …
Run Code Online (Sandbox Code Playgroud)

visual-studio asp.net-core angular-cli asp.net-core-webapi angular

4
推荐指数
1
解决办法
4517
查看次数