JSBuild fail after update

Hi, I updated to hugo 0.78.2 and my jsbuild stopped working. It fails importing json files outside of the assets folder: Could not resolve “…/…/i18n/es.json”

It was working fine in hugo 0.78.0

I need those files in the [PROJECT_ROOT]/i18n because they are shared between hugo and the js build.

I appreciate any thoughts on this. Thanks! :slight_smile:

To cut a long story short:

  1. You need to mount your language files in both i18n and assets
  2. Then you can use import paths relative to assets

I’m sorry for the breakage, but the current approach (which I’m pretty sure is conceptually right) was not possible do do until ESBuild got its plugin system.

Added note: I do also suspect that, if this is the project and not a theme, that you can also do “i18n/es.json” (relative to the project folder).

Thanks bep. “i18n/es.json” didn’t work (i’m working on a project, not a theme) but the mount did the trick.

:slight_smile:

1 Like

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