Closed skubus closed 10 years ago
You need to use the cwd
option to get what you want:
preBundleCB: function (b) {
b.plugin(remapify, {
src: 'config.js',
expose: 'config',
cwd: 'path/to/source',
config: {verbose: true}
});
}
Hya all,
I'm running into issues concerning the expandedAliases being passed to aliasify. As I understand it,
aliasify.configure
expects an object with aliases formatted as{alias: path/to/alias}
, so that I may laterrequire('alias')
. Unfortunately the alias attribute is being garbled.My directory setup is as follows:
I wish to call the config in the init.js (and elsewhere, but the init serves as proof of concept) via
require('config')
. I've added remapify as a plugin to browserify in the Gruntfile:Now I would expect mapify to pass something like
{config: 'absolute/path/to/source/config.js'}
to aliasify. Instead, when I log theexpandedAliases
object in theglobMatch
callback, I receive following output:The attributes keys look kind of strange to me (and my
require('config')
barks errors at me). On the other hand, if I replace:with
this object is passed to aliasify:
{config: 'absolute/path/to/source/config.js'}
. All is well (I can access the config viarequire('config')
without a problem).Is this a configuration/set-up error on my part? Where am I going wrong?
Thank-you in advance for any support. :)