Skip to content

Dynamic require in conjunction with envify #166

Open
@kwoon

Description

@kwoon

Hi! I form the config for a large project kit in the following way in conjunction with envify

module.exports = xtend(
  require('../config/__defaults/common'),
  require('../config/__defaults/' + process.env.stage),
  require('../config/' + process.env.project + '/common'),
  require('../config/' + process.env.project + '/' + process.env.stage)
)

When i bundle project with browserify all works perfectly!

NODE_ENV=production browserify src/index.js \
  -t [envify --project ${1:-'main'} --stage ${2:-'dev'}] \
  -g uglifyify \
  > bundle.min.js

But when i try to use this browserify configuration with budo

budo src/index.js:bundle.js -P -- \
  -t [envify --project ${1:-'main'} --stage ${2:-'dev'}]

budo returns me

Cannot find module '../config/__defaults/dev'

but i have this file.

So, maybe you know what i'm doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions