Skip to content

rebuild time depends on assets #20244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
montella1507 opened this issue Mar 11, 2021 · 4 comments · Fixed by #20466
Closed

rebuild time depends on assets #20244

montella1507 opened this issue Mar 11, 2021 · 4 comments · Fixed by #20466

Comments

@montella1507
Copy link

montella1507 commented Mar 11, 2021

Versions:

"@angular/animations": "^11.0.4",
   "@angular/cdk": "^11.0.2",
   "@angular/common": "^11.0.4",
   "@angular/compiler": "^11.0.4",
   "@angular/core": "^11.0.4",
   "@angular/forms": "^11.0.4",
   "@angular/localize": "^11.0.4",
   "@angular/platform-browser": "^11.0.4",
   "@angular/platform-browser-dynamic": "^11.0.4",
   "@angular/router": "^11.0.4"
  "@angular-devkit/build-angular": "^0.1100.4",
   "@angular-eslint/eslint-plugin": "0.8.0-beta.5",
   "@angular-eslint/eslint-plugin-template": "0.8.0-beta.5",
   "@angular-eslint/template-parser": "0.8.0-beta.5",
   "@angular/cli": "^11.0.4",
   "@angular/compiler-cli": "^11.0.4",
   "@angular/language-service": "^11.0.4",

Rebuild time is somehow affected by assets in angular.json - here are table with times with and without assets:

   "assets": [
              "apps/edhance/src/favicon.ico",
              "apps/edhance/src/assets",
              "apps/edhance/src/config.json",
              {
                "glob": "**/*",
                "input": "apps/edhance/configs",
                "output": "./configs/"
              }
            ],

image

Difference in first build is comprehensible (to copy static - immutable assets to serve folder), however, why is so big difference in rebuild time when i change typescript file?

image

(another project)
image

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Mar 11, 2021

This is unfortunately how https://webpack.js.org/plugins/copy-webpack-plugin works with Webpack 4. With every re-build the assets patterns are re-processed and copied over and over again.

With Webpack 5 & caching enabled this should get better eventually as this plugin use caching to reduce IO calls https://github.com/webpack-contrib/copy-webpack-plugin/blob/01fa91b09d3b4fdc4552b520bb90918fc7f34e54/src/index.js#L604

@montella1507
Copy link
Author

:-( So it may be possible to try performance boost with:

"resolutions": {
    "webpack": "^5.0.0"
}

right?

@alan-agius4
Copy link
Collaborator

yes

@alan-agius4 alan-agius4 changed the title Rebuild time depends on assets rebuild time depends on assets Apr 8, 2021
@alan-agius4 alan-agius4 linked a pull request Apr 8, 2021 that will close this issue
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants