strongloop / strong-arc

StrongLoop Arc has been replaced by API Connect. We recommend Arc users move to the Essentials edition of API Connect. If you have questions, please email reachsl@us.ibm.com.
http://strongloop.com/
Other
114 stars 36 forks source link

Build from slc arc doesn't exclude files and folders in .npmignore #1716

Open nodejsbspa opened 8 years ago

nodejsbspa commented 8 years ago

Hi, I tried to build a tar file of my app using slc arc but I found something odd to me because the final .tar file included some files and folders that shouldn't have been there.

I had created the .npmignore file since it's mandatory in order to exclude folders and files I don't want to be in production but that seemed to be ineffective. It seems to me that strong-arc don't consider the .npmignore.

I looked into the code and went through the modules strong-arc (version 1.8.8) -> strong-build(version 2.1.0) -> strong-pack (version 1.0.0).

In the modules strong-pack (which creates the .tar file), in the index.js, line 23, the files to be excluded from the final .tar file are listed in the variable FILTER (https://github.com/strongloop/strong-pack/blob/master/index.js#L9). They aren't taken from the .npmignore.

Would be possible to modify the function pack in index.js of module strong-pack (https://github.com/strongloop/strong-pack/blob/master/index.js#L21) to accept a second argument to override the global variable FILTER? That function is called at the line 223 in the file index.js in module strong-build (https://github.com/strongloop/strong-build/blob/master/index.js#L223) would have to pass as second parameter the list of files to exclude. The module strong-build would also have to read the .npmignore (of course).

Might that be a good point? Thanks