1.0.0 • Published 8 years ago

browserify-conditionalify v1.0.0

Weekly downloads
181
License
MIT
Repository
github
Last release
8 years ago

Note

This project is based on skrat's jpp

Installing

$ npm install browserify-conditionalify

Usage

var conditionalify = require('browserify-conditionalify');
browserify(
    transform: [[conditionalify, { definitions: { 'isEnabled': true } }]]
)

Example

#if isEnabled            
    console.log('product enabled');
#endif

or

#if isEnabled            
    console.log('product enabled');
#else 
    console.log('product is disabled');
#endif

also with '//' because Using this transform results in an syntax error since '#' is not used for comments in Javascript.

//#if isEnabled            
    console.log('product enabled');
//#endif

or

//#if isEnabled            
    console.log('product enabled');
//#else 
    console.log('product is disabled');
//#endif

License

MIT