Skip to content

Using different options for js.Build for different output formats not working as expected #14254

@cmahnke

Description

@cmahnke

This is a follow up of Discourse #56352:

Initially I thought that the loaders param of js.Build was just not working. But it turns out that it actually is.

The issue seems to be that if there are different sets of options for different output formats won't get applied to js.Build as expected. In this case this one call (for the default output format) is passing no loaders (thus using the defaults) an one is (passing explicit loaders). Only the first config is actually used.

What version of Hugo are you using (hugo version)?

$ hugo version
hugo v0.152.2+extended+withdeploy darwin/arm64 BuildDate=2025-10-24T15:31:49Z VendorInfo=brew

Does this issue reproduce with the latest release?

Yes

Reproduction

See https://github.com/cmahnke/hugo-test/tree/loaders

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions