Read the statement by Michael Teeuw here.
Module Ability to Add Packages to Vendor Directory
-
Hello!
I am posting this here, but I am not sure if this feature already exists in some way or another.
As I developed the Magic Mirror module MMM-GConnect (https://github.com/tderflinger/MMM-GConnect) I wanted to use the Preact (https://preactjs.com/) library to make my UI programming more efficient for me. Preact is basically a lightweight version of the popular React library.The only way to make Preact work in my module was to install it in the vendor directory and add a reference in vendor/vendor.js.
The thing now is when users of my module want to install MMM-GConnect, they need to manually install Preact and add the lines to vendor/vendor.js.
Is there a standard way to do that in Magic Mirror that I am not aware of? If not, I would propose to add a feature to make it possible for modules to add packages to vendor automatically as part of their install routine.
Thanks for your opinion!
-Thomas
-
@MMRIZE , yes, your getScripts function suggestion worked! Thanks!
-
- This doesn’t work?
getScripts: function () { return [ this.file('node_modules/preact/dist/preact.min.js'), //from this module's directory ] }- Or you can serve
preinstallorpostinstallscripts for your module to handle that kind of job (additional install, move/rename files, etc.)
-
@MMRIZE , yes, your getScripts function suggestion worked! Thanks!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login