Browserify multiple transforms error

250 views Asked by At

Trying to run multiple transforms with browserify.

I have the following files in a directory

  • dev.json
  • stage.json
  • prod.json
  • index.js

The json files are environment specific config files.

index.js :

var mode = process.env.APP_ENV; module.exports = require('./' + mode + '.json');

I am using the envify transform to pick between dev/prod/stage and configurify to evaluate dynamic expressions.

If I just run the envify it works fine but when I use envify followed by configurify, I get an error saying "./undefined.json" not found.

enter image description here

Any help is appreciated.

1

There are 1 answers

0
user843453 On

Took some to understand how browserify transforms work using streams. Apparently the configuriy transform was not using the stream and instead reading the file form disk. Opened an issue.