# How to mount a node\_modules folder?

**URL:** <https://discourse.gohugo.io/t/how-to-mount-a-node-modules-folder/57498>\
**Category:** support\
**Created:** [August 25, 2026, 9:06pm UTC](https://discourse.gohugo.io/t/how-to-mount-a-node-modules-folder/57498 "2026-08-25T21:06:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![doompadee](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/doompadee/32/15894_2.png) [@doompadee](https://discourse.gohugo.io/u/doompadee)\
**Post date:** [August 25, 2026, 9:06pm UTC](https://discourse.gohugo.io/t/how-to-mount-a-node-modules-folder/57498/1 "2026-08-25T21:06:26Z")

</div>

Hello,

I cannot figure out how to mount a node\_modules package in order to have an import resolved by `css.PostCSS` when using Hugo 0.165.0. I use tailwindcss 3 and therefore have to stay with `css.PostCSS` if I understand that part correctly.

```auto
[[module.mounts]]
source = "node_modules/maplibre-gl/dist"
target = "assets/maplibre-gl"

```

`hugo config mount` looks good:

```auto
"mounts": [
{
"source": "assets",
"target": "assets"
},
{
"source": "content",
"target": "content"
},
{
"source": "node_modules/maplibre-gl/dist",
"target": "assets/css/maplibre-gl"
},

```

But `resources.Get "maplibre-gl/maplibre-gl.css"` or any `resources.GetMatch` does not find the file. The goal would be to provide this resource via `importContext` to `css.PostCSS` to have it resolved.

The whole ordeal currently looks like this:

```go

{{- $styles := (slice (resources.Get "css/tailwind.css")) -}}
{{- /\* Include styles provided by modules. \*/ -}}
{{- if (reflect.IsMap .) -}}
{{- range $name, $data := .modules -}}
{{- with (index $data "css") -}}
{{ $styles = $styles | append . }}
{{- end -}}
{{- end -}}
{{- end -}}
{{- $maplibre := resources.Get "css/maplibre-gl/maplibre-gl.css" -}}
{{ warnf "CSS %s %s" $styles $maplibre }}
{{ if not $maplibre }}
{{ errorf "MAPLIBRE NOT FOUND" }}
{{ end }}
{{- $options := dict "inlineImports" true "skipInlineImportsNotFound" false -}}
{{- $styles = $styles | resources.Concat "css/main.css" | css.PostCSS $options -}}

```

Am I missing something or is this approach not feasible? Thanks.

---

<div class="post-metadata">

**Author:** ![doompadee](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/doompadee/32/15894_2.png) [@doompadee](https://discourse.gohugo.io/u/doompadee)\
**Post date:** [August 26, 2026, 7:23am UTC](https://discourse.gohugo.io/t/how-to-mount-a-node-modules-folder/57498/2 "2026-08-26T07:23:35Z")

</div>

OK, as its often the case, after some sleep I got it working again. Ditched the Hugo importing and fall back to the `postcssImport` plugin. I had to adjust the paths of the local imports to include the paths though. And that although the asset path has been provided to the plugin. Tried several variations, relative, absolute. The import plugin shows me its lookup paths, they are correct, the files are in there, but they cannot be found when the file import is not provided with a path like `@import "/assets/css/fonts.css";`.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [August 28, 2026, 7:23am UTC](https://discourse.gohugo.io/t/how-to-mount-a-node-modules-folder/57498/3 "2026-08-28T07:23:58Z")

</div>

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