jmm / pathmodify

In a nutshell, rewrite (AKA alias, map) `require()` IDs / paths / directories to different values in browserify.
MIT License
27 stars 1 forks source link

use with grunt-browserify #3

Closed andrewc89 closed 8 years ago

andrewc89 commented 9 years ago

Is it possible to use the plugin with grunt-browserify? I tried to set it up in a similar fashion to the remapify example in the grunt-browserify README [1] but it doesn't seem to be working.

[1] https://github.com/jmreidy/grunt-browserify#alias

jmm commented 9 years ago

Hello @gwely, thanks for your interest! It could be this issue with the way I setup the module's export. It sounds like you could use this configure hook to use pathmodify normally with the Browserify API. (I would just do that anyway unless there's a good reason not to.) So I think it'd be something like this:

var pathmod = require('pathmodify');

options: {
  configure: browserify_configure,
}

function browserify_configure (b) {
  // Note the function call.
  b.plugin(pathmod(), {/* ... */});
}
andrewc89 commented 9 years ago

That worked! Thanks so much.

jmm commented 8 years ago

@gwely Great! You're welcome.