Module mounts incompatible with PostCSS import?

See https://gohugo.io/hugo-modules/configuration/#module-config-mounts.

When the mounts config was introduced in Hugo 0.56.0, we were careful to preserve the existing staticDir and similar configuration to make sure all existing sites just continued to work.

But you should not have both. So if you add a mounts section you should make it complete and remove the old staticDir etc. settings.

That is immediately followed by this example:

  [[module.mounts]]
    source = "content"
    target = "content"

  [[module.mounts]]
    source = "static"
    target = "static"

  [[module.mounts]]
    source = "layouts"
    target = "layouts"

  [[module.mounts]]
    source = "data"
    target = "data"

  [[module.mounts]]
    source = "assets"
    target = "assets"

  [[module.mounts]]
    source = "i18n"
    target = "i18n"

  [[module.mounts]]
    source = "archetypes"
    target = "archetypes"

I cloned your repo, then edited your config.toml:

[[module.mounts]]
source = "assets"
target = "assets"

[[module.mounts]]
source = "./node_modules/lazysizes"
target = "assets/npmplugins/lazysizes"

Now it builds.

The documentation is a bit cryptic. What I think it means is:

  • If you add a mount where the target root is archetypes/, the default mount of archetypeDir is clobbered (ignored).
  • If you add a mount where the target root is assets/, the default mount of assetDir is clobbered (ignored).
  • If you add a mount where the target root is content/, the default mount of contentDir is clobbered (ignored).
  • If you add a mount where the target root is data/, the default mount of dataDir is clobbered (ignored).
  • If you add a mount where the target root is layouts/, the default mount of layoutDir is clobbered (ignored).
  • If you add a mount where the target root is static/, the default mount of staticDir is clobbered (ignored).
2 Likes