How to use the .npmignore


#1

How to use the .npmignore.

I was create a Atom language package. https://atom.io/packages/language-review

I wrote it by TypeScript. not JavaScript and CoffeeScript.
I want to commit to git repository only .ts files.
but apm publish are read only .gitignore.
I want to use .npmignore. https://www.npmjs.org/doc/misc/npm-developers.html#keeping-files-out-of-your-package.

Do I have to commit even extra code?


.npmignore for APM (.apmignore?)
#2

If I’m understanding correctly, the two files are for completely different purposes. .npmignore is for keeping files out of an npm package, which you’re not creating. You’re creating an Atom package. .gitignore is for keeping files out of a Git repository, which apm is dependent on. So, why would .npmignore work for what you want to do?


#3

@leedohm thank you for your reply.

I want to do apm publish. it required the JavaScript files (it created by TypeScript code.)
but I want to exclude JavaScript files from my git repository. because it is working files. it generated by grunt tasks.
I think .npmignore is good idea. It allows the above behavior.

I thought apm are npm wrapper. but it is wrong.
We are need a .apmignore. isn’t it?


#4

.gitignore keeps files out of the Git repository already. There is no need for an .apmignore.


#5

I want keeps JavaScript files out of the Git repository.
but I want to publish JavaScript files contains of the Apm Package.


#6

Ah ok … thank you. I understand now :blush:

The contents of the Git repository are the contents of your Atom package. So if you keep them out of the Git repo, then they aren’t in your package. I’m pretty sure I heard that the Atom team plans long-term to support other package repositories than atom.io and maybe this kind of thing would be possible with a different package repository … but I think for now you’ll have to include the JavaScript files in your Git repository.


#8

@leedohm oh. i understand. thank you!
I try to read the code of apm. :smiley_cat:


#9

Purely as an experiment. An ugly hack would be to push to NPM and then have a seperate git repository as the apm package which only has a package.json depending on the npm package and pointing its main to be inside that package.

Then you publish to NPM.

I would never do this though.


#10

I want .apmignore. Can we make this a thing?


#11

You may want to subscribe here for updates: