gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
76.22k stars 7.55k forks source link

Add support for mounting NPM packages #8956

Open bep opened 3 years ago

bep commented 3 years ago

A quick writeup while thinking about this. This idea has struck me before, but I suspect I haven't found the simple solution.

Pseudo code I think it could look like this:

[module]
[[module.imports]]
path = "npm:alpinejs'

And then implement the GOPROXY protocol on top of NPM:

https://golang.org/ref/mod#goproxy-protocol

bep commented 3 years ago

I have a working prototype of the above at https://github.com/bep/npmgoproxy -- it's still rough around the edges, but it's cool that it actually works.

github-actions[bot] commented 2 years ago

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. If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open. If this is a feature request, and you feel that it is still relevant and valuable, please tell us why. This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.