Repository navigation
Support the webpack publicPath: 'auto' configuration #307
Copy link
Copy link
Closed
Description
Activity
PR welcome
Reacted by m10charliecreates commented
on Oct 30, 2025 on Oct 30, 2025 – with CharlieCreatesContributorMore actionsExpand this to see my work.
- Read Issue #307 and reviewed the report that
'auto'fromcompiler.options.output.publicPathwas being emitted literally, clarifying expected behavior. - Audited
test/unit/paths.tsforpublicPath/basePathcoverage and confirmed no existing'auto'case. - Identified the correct spot in
test/unit/paths.tsto assert that'auto'should not prefix manifest URLs. - Traced how URLs are composed from
compiler.options.output.publicPathinsideWebpackManifestPluginto understand current behavior. - Added a unit test in
test/unit/paths.ts: "does not prefix paths when webpack's publicPath is 'auto'", expecting'one.js': 'one.<hash>.js'(no'auto'prefix). - Built the project with
tscand ran the suite; vitest summary shows: "✓ test/unit/paths.ts (11 tests)" and overall "45 passed | 5 skipped (50)", confirming the new'auto'test passes. - Cross-checked behavior against webpack docs for Automatic publicPath; current output matches docs (no literal
'auto'in manifest values).
Reacted by Roman Czerkies- Read Issue #307 and reviewed the report that
- added a commit that references this issue
on Oct 30, 2025 charliecreates commented
on Oct 30, 2025 on Oct 30, 2025 – with CharlieCreatesContributorMore actionsImplemented support for webpack’s automatic publicPath. When
output.publicPathis set to'auto', the plugin now treats it as runtime‑resolved and does not prefix manifest values with the literal stringauto.Opened PR: #312
Changes
- In
src/hooks.ts, resolvestats.publicPath/options.publicPathand treat the literal'auto'as empty so manifest paths are not prefixed. - Added a unit test in
test/unit/paths.tsto assert that'auto'does not appear in manifest values.
Verification
# Build $ pnpm build # OK # Tests (Vitest) $ pnpm test # Test Files: 12 passed | 4 skipped (16) # Tests: 45 passed | 5 skipped (50) # Lint # Skipped (preexisting tool issue with ESLint 9.38 + custom parser serialization). # Not related to this change; build and tests pass locally.
Reacted by Roman Czerkies- In
- added a commit that references this issue
on Oct 30, 2025
Metadata
Metadata
Assignees
Labels
No labels
Expected Behavior
Use the "auto" mechanism of webpack publicPath configuration.
Actual Behavior
"auto" as a string is added to asset paths in the manifest.
Additional Information
When I use in production mode, your great plugin for webpack, the "new" way do declare
autoinpublicPathinside thewebpack.config.js, the plugin takes the value as a string.Maybe a condition could be added to take that special feature.
Thanks!