Configure which browserify transforms get applied to your package via an environment variable.
{ "browserify": { "transform": [ "hbsfy", "transfigurify" ] }, "transfigurify": { "test": [ "brfs" ] }, "dependencies": { "brfs": "0.0.9", "hbsfy": "~0.1.3", "transfigurify": "~0.1.0" } }
In this configuration the hbsfy
transform runs always, but the brfs
transform is applied only if TRANSFIGURIFY_ENV=test
, i.e:
TRANSFIGURIFY_ENV=test browserify main.js > bundle.js
Please review and try this full example to get a better understanding of how transfigurify works.
Reading the tests is also benefitial to that end.
npm install transfigurify
The env variable which is used by transfigurify to determine which transforms config in the package.json
to use in order to apply transforms.
You need to set this or provide it via the TRANSFIGURIFY_ENV
environment variable.
// setting from javascript
transfigurify.env = 'test';
# setting from command line
TRANSFIGURIFY_ENV=test browserify -t transfigurify ...
browserify transform which applies a set of browserify transforms that are configured inside package.json
. Multiple sets can be configured and a matching one selected depending on the TRANSFIGURIFY_ENV
environment variable.
This variable can also be set directly via transfigurify.env='x'
.
If no matching configuration is found or the environment variable wasn't set a through stream is returned which means that the file will not be transformed by transfigurify.
Name Type Descriptionfile
string
file whose content is to be transformed
transform that is composed of the transforms that were configured for the environment (if any)
generated with docme
MIT
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4