Skip to content

Commit 718eedd

Browse files
committed
fix: restore filesystem cache for function js filename, #190
1 parent 05f66f4 commit 718eedd

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 4.23.2 (2026-06-01)
4+
5+
- fix: restore Webpack filesystem cache builds when a cached HTML template references a script and `js.filename` is configured as a function, #190
6+
The plugin persistent cache now excludes non-serializable entry options from the serialized collection data and restores them from the current entry configuration during deserialization.
7+
This prevents the second filesystem-cache build from losing the script and failing with a false `Can't resolve .../src/main.js` error.
8+
39
## 4.23.1 (2026-05-31)
410

511
- fix: prevent watcher crash in multi-compiler mode when Webpack invalidates a compilation with a `null` filename after deleting a watched source file, #191

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "html-bundler-webpack-plugin",
3-
"version": "4.23.1",
3+
"version": "4.23.2",
44
"description": "Generates complete single-page or multi-page website from source assets. Built-in support for Markdown, Eta, EJS, Handlebars, Nunjucks, Pug. Alternative to html-webpack-plugin.",
55
"keywords": [
66
"html",

src/Plugin/Collection.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,8 @@ class Collection {
11101110
if (imported) {
11111111
importedStyles.push(asset);
11121112
} else if (inline) {
1113-
content = (await this.#inlineStyle(content, resource, asset, LF, externalStyleAssets, entry)) || content;
1113+
content =
1114+
(await this.#inlineStyle(content, resource, asset, LF, externalStyleAssets, entry)) || content;
11141115
} else {
11151116
// special use case for Pug only e.g.: style(scope='some')=require('./component.css?include')
11161117
const [, query] = resource.split('?');
@@ -1341,6 +1342,7 @@ class Collection {
13411342
// the original functions will be recovered by deserialization from the cached object `AssetEntry`
13421343
entry.filenameFn = null;
13431344
entry.filenameTemplate = null;
1345+
entry.options = null;
13441346
}
13451347

13461348
write(this.assets);
@@ -1361,6 +1363,7 @@ class Collection {
13611363
// recovery original not serializable functions from the object cached in the memory
13621364
entry.filenameFn = cachedEntry.filenameFn;
13631365
entry.filenameTemplate = cachedEntry.filenameTemplate;
1366+
entry.options = cachedEntry.options;
13641367
}
13651368

13661369
this.deserialized = true;

0 commit comments

Comments
 (0)