ExampleSite and Tailwind

I am facing the same problem noted here Tailwind CSS Failing when running ExampleSite. What is the Hugo way to run example sites?

Dunno if that is the Hugo way but this works for me or at least the log prints something.

Windows 11 - PowershellCore 0.165.0
see below for comments on 160.0

Add c:\path\to\SITE\node_modules\.binto $env:PATH

steps:

  • followed css.TailwindCSS docs
    ! the build stuff goes in the example sites hugo.toml !

  • i did not copy the content but used a mount

  • added c:\path\to\SITE\node_modules\.binto $env:PATH

  • i did not add any tailwind classes

  • exampleSite Structure:

    path/to/SITE
    ├───node_modules
    │   └───.bin
    └───themes
        └───quick
            └───exampleSite
                └───hugo.toml
    
  • hugo.toml

    baseURL = 'https://example.org/'
    locale = 'en-us'
    title = 'My New Hugo Project'
    
    [build]
      [build.buildStats]
        enable = true
      [[build.cachebusters]]
        source = 'assets/notwatching/hugo_stats\.json'
        target = 'css'
      [[build.cachebusters]]
        source = '(postcss|tailwind)\.config\.js'
        target = 'css'
    [module]
      [[module.mounts]]
        source = 'assets'
        target = 'assets'
      [[module.mounts]]
        source = '../content'
        target = 'content'
      [[module.mounts]]
        disableWatch = true
        source = 'hugo_stats.json'
        target = 'assets/notwatching/hugo_stats.json'
    [security]
      [security.exec]
        allow = ['^(dart-)?sass$', '^go$', '^git$', '^node$', '^postcss$', '^tailwindcss$']
    

log

INFO  exec: resolve "tailwindcss" location PATH bin C:\_path\to\SITE\node_modules\.bin\tailwindcss.cmd script C:\_path\to\SITE\\node_modules\@tailwindcss\cli\dist\index.mjs
INFO  tailwindcss: ≈ tailwindcss v4.3.3
INFO  tailwindcss:
INFO  tailwindcss: Done in 18ms

with v0.160.0 it works without path addition, but it tries npx to find tailwind which is allowed in 160.

  [security]
    [security.exec]
      allow = ['^(dart-)?sass$', '^go$', '^git$', '^node$', '^postcss$', '^tailwindcss$', '^npx$']

log

INFO  exec: resolve "tailwindcss" using npx
INFO  tailwindcss: ≈ tailwindcss v4.3.3
INFO  tailwindcss:
INFO  tailwindcss: Done in 15ms

and no – adding npx won’t help with 0.161+