PERF: Update ember-auto-import and webpack (#15919)

This makes a small improvement to 'cold cache' ember-cli build times, and a large improvement to 'warm cache' build times

The ember-auto-import update means that vendor is now split into multiple files for efficiency. These are named `chunk.*`, and should be included immediately after the `vendor.js` file. This commit also updates the rails app to render script tags for these chunks.

This change was previously merged, and caused memory-related errors on RAM-constrained machines. This was because Webpack 5 switches from multiple worker processes to a single multi-threaded process. This meant that it was hitting node's default heap size limit (~500mb on a 1GB RAM server). Discourse's standard install procedure recommends adding 2GB swap to 1GB-RAM machines, so we can afford to override's Node's default via the `--max-old-space-size` flag.
This commit is contained in:
David Taylor
2022-02-14 11:21:39 +00:00
committed by GitHub
parent c4e34047a1
commit a01b1dd648
15 changed files with 1739 additions and 122 deletions

View File

@@ -15,10 +15,11 @@
"start": "ember serve"
},
"dependencies": {
"ember-auto-import": "^1.5.3",
"ember-auto-import": "^2.2.4",
"ember-cli-babel": "^7.13.0",
"ember-cli-htmlbars": "^4.2.0",
"xss": "^1.0.8"
"xss": "^1.0.8",
"webpack": "^5.67.0"
},
"devDependencies": {
"@ember/optional-features": "^1.1.0",