-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ToCSS includePaths ignores paths from parent directory (../node_modules) #6274
Comments
This is possibly a bug introduced by my 0.57 changes. That said, I think you would get a simpler setup/easier to reason about if you use the new module mounts setup. E.g. (from memory):
If you get those paths in line you should not need to add any |
@bep Thanks I was looking into it and it does indeed look like the introduction of modules might have interfered with this feature. You suggestions to use modules (which is a really cool new feature btw) works! Specfically (and for anyone stumbling upon this) the corrrect configuration is: [module]
[[module.mounts]]
source = "static"
target = "static"
[[module.mounts]]
source = "../node_modules/bulma"
target = "assets/scss/bulma" I had to mount the For me this is a perfectly acceptable solution. I find it much cleaner and explicit than passing the |
I agree. It would be cool if you could lend us a hand, now that you know how it works... But I will fix this particular issue, as this was an unintended side effect. But I do agree that using the file mounts is a cleaner and easier to reason about solution. And it gets even cooler when you mount folders inside other GitHub projects ... |
I tried to create a failing test similar to your setup, but I failed (or succeeded ...). Which means that there is something I'm not seeing in your setup ... |
Hi sorry for the late reply. I can do a simple set up for testing. I am also happy to lend an hand. Which approach do you prefer:
|
Hi @bep. I think I reproduced this case. The quickest way would be to modify Netlify's Victor Hugo's template:
As a side note, with Hugo 0.67.1, specifying the modules with @0xjac's configuration results in the following error on my build:
|
I just ran into this with a monorepo using a structure where the Hugo project sits alongside a Node package for styling used by multiple apps.
Would be awesome to see proper support for include directories outside the site added, but at least the modules way can work without hardcoding the paths in the SCSS files too :) |
I can't even get the |
Error
When running
hugo
, it fails with the following error:Project Structure (abridged)
project/site/themes/custom-theme/assets/scss/main.scss
head
Hugo Versions
OS
Notes
I tried playing with various variations of paths in the head (such as
node_modules
,./node_modules
, absolute path, ...) and inmain.scss
(such as./bulma/bulma
,../bulma/bulma
, ...) and nothing works. The only way around is to not useincluePaths
and instead to hard-codenode_modules
in the scss file, as in:@import './node_modules/bulma/bulma';
.Note that using
includePaths
as described in this setup works fine with the following hugo version:The text was updated successfully, but these errors were encountered: