Closed taylorhakes closed 9 years ago
Readme shows
var browserify = require('browserify') , remapify = require('remapify') , b = browserify(__dirname) b.plugin(remapify, [ { src: './client/views/**/*.js' // glob for the files to remap , expose: 'views' // this will expose `__dirname + /client/views/home.js` as `views/home.js` , cwd: __dirname // defaults to process.cwd() , filter: function(alias, dirname, basename) { // customize file names return path.join(dirname, basename.replace('foo', 'bar')) } } ]) b.bundle()
That information is incorrect. It should be
b.plugin(remapify, [ { src: './client/views/**/*.js' // glob for the files to remap , expose: 'views' // this will expose `__dirname + /client/views/home.js` as `views/client/views/home.js` , cwd: __dirname // defaults to process.cwd() , filter: function(alias, dirname, basename) { // customize file names return path.join(dirname, basename.replace('foo', 'bar')) } } ])
The comment on the expose parameter now reflects what actually happens.
expose
In order to expose views/home.js it should be
views/home.js
b.plugin(remapify, [ { src: '**/*.js' // glob for the files to remap , expose: 'views' // this will expose `__dirname + /client/views/home.js` as `views/client/views/home.js` , cwd: './client/views' , filter: function(alias, dirname, basename) { // customize file names return path.join(dirname, basename.replace('foo', 'bar')) } } ])
Notice the change to cwd and src. I am not sure what caused this change, but it took a while for me to debug the cause.
cwd
src
Unfortunately, there is a related issue https://github.com/joeybaker/remapify/issues/33 that causes the files to be pointing at the wrong location.
Closing as duplicate of https://github.com/joeybaker/remapify/issues/23
Readme shows
That information is incorrect. It should be
The comment on the
expose
parameter now reflects what actually happens.In order to expose
views/home.js
it should beNotice the change to
cwd
andsrc
. I am not sure what caused this change, but it took a while for me to debug the cause.Unfortunately, there is a related issue https://github.com/joeybaker/remapify/issues/33 that causes the files to be pointing at the wrong location.