Skip to content

NXT-18691: Added improvements for webpack - #165

Open
daniel-stoian-lgp wants to merge 1 commit into
developfrom
feature/NXT-18691
Open

NXT-18691: Added improvements for webpack#165
daniel-stoian-lgp wants to merge 1 commit into
developfrom
feature/NXT-18691

Conversation

@daniel-stoian-lgp

@daniel-stoian-lgp daniel-stoian-lgp commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • I have read and understand the contribution guide
  • A CHANGELOG entry is included
  • I have run automated testing and it is passed
  • Documentation was added or is not needed
  • This is an API breaking change

Issue Resolved / Feature Added

  1. --no-minify had no effect (bug fix)
    mixins/unmangled.js assigned terserPlugin.options.terserOptions. But terser-webpack-plugin destructures terserOptions in its constructor, resolves it into options.minimizer.options, and reads only that at runtime — options.terserOptions does not exist on the instance afterwards.
    Every --no-minify build therefore produced fully-minified, fully-mangled output. The only effect that did apply was config.output.pathinfo, which is why dist/ totals looked almost right (60.0 MB vs 59.7 MB) rather than obviously broken — the flag looked like it was working.

Verified directly:

has .options.terserOptions after construction? false
mangle after the old-style mutation: {"safari10":true} <-- unchanged

The fix mutates the resolved options object instead.

Command Before After
pack -p --no-minify — main.js 1114 KB (identical to a minified build) 3695 KB

  1. ILibPlugin : pooled and cached asset reads

handleManifestFiles read one file at a time via callback-per-file recursion (fs.readFile → wait → recurse). Across the ~6,750-file iLib tree that serialises thousands of disk round-trips into the build's critical path.
There is also a related issue under serve: shouldEmit decides whether to skip a file by stat-ing its destination, but the dev server's output filesystem is in-memory (webpack-dev-middleware), so there is never a destination to stat — every one of the ~6,750 files was re-read from disk on every single compile of a dev-server session, not just the first.
This change fans reads out over a bounded (32-way) concurrency pool and adds a source-keyed (mtime + size) read cache so repeat compiles in the same process reuse the already-read buffer. shouldEmit now returns its already-computed source fs.Stats alongside the decision, so each file is stat-ed exactly once — same as before, not twice.

Resolution

Additional Considerations

Links

NXT-18691

Comments

@daniel-stoian-lgp daniel-stoian-lgp changed the title added improvements for webpack NXT-18691: Added improvements for webpack Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant