Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

command-line usage: .pathmodifyrc or ? #8

Open
dey-dey opened this issue Dec 19, 2015 · 4 comments
Open

command-line usage: .pathmodifyrc or ? #8

dey-dey opened this issue Dec 19, 2015 · 4 comments

Comments

@dey-dey
Copy link

dey-dey commented Dec 19, 2015

been looking for something like this that actually works for a while, so thank you!

i'm curious if you'd accept PRs for setting config from command line. something like:

browserify index.js -o build/bundle.js -p [ pathmodify --config ./.pathmodifyrc ]

that way you can configure it for tools that don't allow programmatic configuration.

@dey-dey
Copy link
Author

dey-dey commented Dec 19, 2015

or simply checking for rc file

@jmm
Copy link
Owner

jmm commented Dec 21, 2015

Thanks @daedelus-j!

Doing something like this has crossed my mind. I don't use the CLI, so it hasn't been a high priority. Let me consider this.

Considering that you'd have to create a new file anyway, if you need this right now you can probably do something like:

var
  pathmodify = require("pathmodify");

module.exports = function (b, opts) {
  if (opts.cfgFile) {
    opts = require(opts.cfgFile);
  }
  return pathmodify(b, opts);
};
browserify index.js -o build/bundle.js -p [ ./pathmodify --cfg-file ./.pathmodifyrc ]

(Or just embed the cfg directly in that file if you prefer.)

@dey-dey
Copy link
Author

dey-dey commented Dec 23, 2015

good point :) this is easier. mind if i add this to the docs?

@jmm
Copy link
Owner

jmm commented Dec 25, 2015

Thanks @daedelus-j! That sounds good, I just want to figure out where it should go. I want to keep the README focused. This is the second time something like this has come up, so I'm thinking of creating another page of docs about integrations and / or an examples directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants