Using .npmignore with the PKG Bit extension #5022
-
Is it possible to reference an .npmignore file with the PKG Bit extension? When publishing to my NPM repository, I'd prefer to exclude the composition and documentation files for my Bit components. In a typical NPM publishing workflow, this can be achieved by adding a .npmignore file and including what files you want to ignore. For example, I would add an .npmignore file at the root of the repository and add the following items:
When running |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@cdalto , I have added a few days ago an API to add records to a getNpmIgnore() {
return ['*.composition.tsx'];
} Regardless, it's something that you could do even before. Just write .npmignore file during an existing or new build-task. |
Beta Was this translation helpful? Give feedback.
@cdalto , I have added a few days ago an API to add records to a
.npmignore
file. You can use it from your env. e.g.Regardless, it's something that you could do even before. Just write .npmignore file during an existing or new build-task.
If this didn't work for you, maybe you have
files
property in the package.json that whitelists the files to publish. In this case, as far as I know the.npmignore
file is ignored.