-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Add "hugo npm" wrapper command (assets dependencies) #5567
Comments
Maybe |
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help. |
I would still appreciate and use a clean way to pull in node_modules files as resources so that I do not have to maintain a copy of 3rd party libraries in my website's source tree. What we actually currently do at my company is put symlinks to |
I suppose you could also set |
This is related to #5374. But there are many problems/drawbacks with using symbolic links to extend Hugo's directory structure.
This is me thinking out loud, but I think we need to do better. On a general level (for content, static etc.) but I think we can start with
/assets
.For
SCSS
and dependencies insidenode_modules
you would probably useSCSS
relative imports, and that works great. But if you want to, say, concatenate other resources (JS, CSS), you end up with, let's say, less pretty solutions :-)If we could figure out a way to pull in dependencies as configuration (0.53's config dir comes in handy here) from
node_modules
without dumping it all in (we have feature request about a ´resources.GetMatch` function with glob support, so we don't want to dump everything in there ...)So, this is two-folded (at least):
/assets
folder from several, and possibly also set custom "root names", e.g.static/images
=>assets/staticimages
package.json
The first part isn't hard -- the hard part is to agree on a good configuration format.
The second part is harder to get right, I think. I have been thinking about creating a simple wrapper around
npm
and possibly also some kind of machine-writable text format insideconfig/_default/npm_asstets.txt
or something.So I could do:
Or ...
Or something.
And that we, by default, mapped the
dist
directory, so if you didhugo npm install vue
you could do:This is me thinking out loud. To be continued.
And note that I'm not talking about copying files from node_modules; these will still be links, but at the application level.
/cc @regisphilibert @budparr and gang
The text was updated successfully, but these errors were encountered: