You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varbrowserify=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 namesreturnpath.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 namesreturnpath.join(dirname,basename.replace('foo','bar'))}}])
The comment on the expose parameter now reflects what actually happens.
In order to expose views/home.js it should be
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 namesreturnpath.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.
Unfortunately, there is a related issue #33 that causes the files to be pointing at the wrong location.
The text was updated successfully, but these errors were encountered:
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 #33 that causes the files to be pointing at the wrong location.
The text was updated successfully, but these errors were encountered: