mainify
browserify transform for require-relative-main
Install
$ npm install --save mainify
Usage
Application code:
'./users'
Build:
browserify -t mainify ./
You can also use static paths as the `cwd:
'./users' '../app'
You can even use __dirname
:
'./users' __dirname
You cannot assign require-relative-main to a variable and use it later:
var rrm = // => this cannot be replaced
API
mainify(file)
-> transformStream
file
Required
Type: string
The file path to be processed. Browserify will pass this along automatically for each file when you use the transform.
License
MIT © Ben Drucker