Do the mounts in an imported module's config.yaml need to be copied into your module's config.yaml?

  1. Theme uses Hugo Pipes like js.Build and toCSS that relies on node_modules.
  2. Users (site) are required to install the dependencies via hugo mod npm pack && npm install, otherwise users may get cannot resolve errors.
  3. Someday, the theme introduced a feature (v1.1.0) with new dependencies, such as KaTeX.
  4. Users have to install the new dependencies after upgrading the theme to v1.1.0, but users do not aware what dependencies are required.
  5. So the theme should tell users what new dependencies need to be added. Theme could either 1) document the new deps and let users append them into package.json manually, or 2) append the new deps into package.hugo.json, and then users can pull it via hugo mod npm pack.

Which module does your theme import that requires your theme to process JS or CSS?

No, I didn’t use module along with node_modules. My theme doesn’t import any modules.

  1. Theme uses Hugo Pipes like js.Build and toCSS that relies on node_modules.

Actually, I should just stop here. I assume you meant that your theme is running js.Build and toCSS, not the imported module that declares the NPM package. Is that correct? If so, then I see what you’re saying: hugo mod npm pack is only for coordination between importer and imported modules, where the importer module must know beforehand that it must do something with the NPM packages that the imported module declares. This would indeed expose the implementation details of the imported module, which is not what I want.

Yep, there may be a little bit confused.

1 Like

Thanks for your help @razon!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.