oliverwoodings / pkgify

Rewrite module/package require calls to local files in browserify

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when used as command line argument

olizilla opened this issue · comments

browserify ./src/app.js -o ./dist/bundle.js -t [ pkgify --packages [ --foo ./src/foo.js ] ]

Trying to wire up pkgify on the commandline like above fails with a:

TypeError: Object  has no method 'charAt' (while pkgify was processing ...

Because browserify uses https://github.com/substack/subarg there is an _: [ ] property in the options that holds the list of non-option arguments provided. That blows up when the array is assumed to be a string and passed to path.normalize.

See: https://github.com/substack/node-browserify#btransformtr-opts