http://browserify.org/ transformer for organic-dna
-
Install:
$ cd myProject $ npm install browserify-transform-dna
-
Create the following structure and files:
+ myProject |-+ dna | |- client.json |- main.js
-
Create the content:
// client.json { "property": "value" } // main.js var dna = require("dna") console.log(dna.property)
-
Bundle:
$ browserify -t browserify-transform-dna ....
-
See in the browser that
dna.property
is equal tovalue
-
Read more about
- Note that
browserify-transform-dna
usesprocess.env.CELL_MODE
for folding
- default value is
_development