Replies: 3 comments 6 replies
-
Some of my findings why I didn't opt for using Hugo Modules:
Some of my findings on why I did opt for using npm as a dependency manager:
|
Beta Was this translation helpful? Give feedback.
-
Hugo is usually installed in a global location. This way however, your project users could be using different Hugo versions. Hyas however, installs Hugo locally in your project. This way, your project users will always use the same Hugo version. Also now, you and your project users will always use a Hugo version that works with (is tested for) a specific version of Hyas. |
Beta Was this translation helpful? Give feedback.
-
Another important piece of information: Multiple In the course of trying to understand how Hugo mounts work I seem to have pissed off Hugo's lead dev – he closed the forum topic without further comments, so I couldn't ask more specifically. But apparently Hugo does merge Update: The cause of the different results of Footnotes
|
Beta Was this translation helpful? Give feedback.
-
I want to learn what all the (perceived) pros and cons of using Node.js packages (npm) instead of "native" Hugo modules are. I understand that Hyas uses npm to make Hugo itself a dependency of the website you're building (using hugo-installer). But Hyas integrations like images, inline-svg and seo could in principle still be added as Hugo modules instead of npm packages.
(Perceived) pros of npm I imagine:
Hugo modules require a working installation of Golang. This can be worked around to some part by
hugo mod vendor
ing the modules into the project with the added downside of significantly increasing the project's Git repo size (although it's debatable how much a downside this actually is when only using a dozen or less modules that have little to no transitive dependencies).npm package dependencies in a Hugo module are also not a problem. Hugo 0.75 introduced
hugo mod npm pack
to create a compositepackage.json
that accounts for all npm dependencies used in imported Hugo modules. So it's still possible to offer a convenient out-of-the-box experience vianpm install
for Hyas theme end-users.(Perceveived) cons of npm I can think of:
Not embracing Hugos native dependency management infrastructure makes maintaining Hyas integrations more work, I guess. Also users have to wait for new npm releases.
With Hugo modules, we just reference Git refs – as soon as the referenced branch is updated, users can fetch the updated code via
hugo mod get
if they like. KISS.Did I miss misinterpret something? Other thoughts?
Beta Was this translation helpful? Give feedback.
All reactions