npm-bundle
npm-bundle copied to clipboard
Doesn't work with scoped modules
Pretty easy to reproduce.
Simple install any scoped module and run your module.
The tgz file that is generated will not include the scoped module when the tarball is extracted.
Thanks, I will look into this
Looks like this is an npm issue: npm/npm#9175
I will investigate a stop-gap work around.
A workaround seems like a very good idea. The npm issue appears to have stalled…
To get this to work with a scoped module is just a matter of a simple fix on npm-bundle's index.js, on the glob.bind(null, '*') line.
the problem is simply that npm-bundle does not find the package.json directly as child of the first folder in .nmpbundle/node_modules.
In other words without scope you have:
.npmbundle/node_modules/your_package/package.json
With scopes you have:
.npmbundle/node_modules/@scope/your_package/package.json
so glob.bind(null, '*') returns @scope which does not have a package.json inside.
So a general fix should be easy to cook, glob.bind(null, '@*/*') is a simple workaround only for scoped cases.
Any progress?