Exclude directory from "h5p pack" command

Forums: 

Hi,

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:

h5p-widget/
├─ 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

Hi!

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

Best,
Oliver

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 :-)