Alvaro
Alvaro

Reputation: 41595

Make npm ignore folders starting by certain prefix

Right now my .gitignore files has the following rule:

demos/test**

Which seems to be working fine with Git (and github) and ignoring the following folders:

./demos/test-whatever/
./demos/test/

But when publishing to npm, those folders are not ignored and are being published.

Any way to exclude them from npm?

Upvotes: 1

Views: 354

Answers (3)

TaoPaipai
TaoPaipai

Reputation: 296

You may want .npmignore to keep files out of your package.

Upvotes: 2

Nathan
Nathan

Reputation: 8151

Create a .npmignore file in your root directory and add your demos/test** ignore rule to this file. For reference:

.npmignore

   demos/test**

Upvotes: 1

rileyjsumner
rileyjsumner

Reputation: 563

Try a .npmignore file More info

Upvotes: 0

Related Questions