hughsk/envify

doesn't seem to work with symlinked files

Closed this issue · 3 comments

So i have some files symlinked into node_modules more on it here.

That way i can require('myServices/service'); instead of require('../../../myServices/service')

Unfortunately if i have something like process.env.MY_VAR inside that file (service.js) it will not be transformed.

Any thoughts or suggestions?

Nevermind it seems that if you have services symlinked or living in node_modules you just have to include another package.json in that folder as well as use the browserify.transform field ie:

"browserify": {
        "transform": ["envify"]
    }
m90 commented

@davidchase Did you ever get this running using command line browserify? Your solution works fine for me when using browserify-middleware but will fail just like before when I try to build a file from the command line:

$ browserify ./public/js/main.js -t jadeify -t envify > ./dist/some-module.js 
m90 commented

Forget about it, I just needed to use -g instead of -t:

$ browserify ./public/js/main.js -g jadeify -g [ envify --NODE_ENV production ] > ./dist/some-module.js