Exclude directory from "h5p pack" command



I'm new to H5P developing. At the moment I wrote my first own widget (based on the awesome) tutorial for the spectrum color picker. Everything works well, but I'm a confused how I can exclude dev-dependencies when I run "h5p pack".

So my directory structure is as follows:

├─ node_modules/
├─ scripts/
├─ package.json
├─ library.json
├─ package-lock.json
├─ README.md

Now, when I run

h5p pack -r h5p-widget

It generates a h5p file as expected but the problem is that the h5p-file also includes the node_modules directory but in my case the node_modules directory contains dev-dependencies only. So is there any way to exclude this directory?

otacke's picture


You'd want to create a file called .h5pignore that works just like .gitignore files. This one should cover most cases ...


Awesome, works perfectly. Thank you very much, Oliver!

otacke's picture

You're welcome! Hope to see some cool new widget to see the light of day soon :-)