Skip to content

ESBuild supports "import *.css" in js file but needs outDir as option for js.Build #8411

Open
@matt9189

Description

@matt9189

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

hugo v0.82.0-9D960784

Does this issue reproduce with the latest release?

Yes


As per esbuild:

You can also import CSS from JavaScript. When you do this, esbuild will gather all CSS files referenced from a given entry point and bundle it into a sibling CSS output file next to the JavaScript output file for that JavaScript entry point. So if esbuild generates app.js it would also generate app.css containing all CSS files referenced by app.js.

This is not currently supported with js.Build and results in an error with modules that include an import in the javascript file.
error: Cannot import "entry.css" into a JavaScript file without an output path configured

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions