Skip to content

Have ESBuild recognize index.esm.js mounted through Hugo modules. #8631

@UtkarshVerma

Description

@UtkarshVerma

This is in regards to the following discussion:
https://discourse.gohugo.io/t/esbuild-looks-like-we-can-finally-get-solid-hugo-modules-support/28757/12?u=utkarshverma

In short, ESBuild doesn't recognize index.esm.js by default, and hence one has to specify an additional export explicitly as such:

  imports:
    - path: github.com/twbs/bootstrap
      mounts:
        - source: scss
          target: assets/scss/bootstrap
        - source: js
          target: assets/bootstrap
        - source: js/index.esm.js
          target: assets/bootstrap/index.js

As npm handles this by default, it would be nice to have this with the ESBuild implementation in Hugo as well. Apart from that, ESBuild modules being relatively new, it took me some time to figure out that an explicit mount for index.esm.js was needed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions