Upload
crgwbr
View
99
Download
0
Embed Size (px)
Citation preview
Module management with globals
Modules individually included on the page
Share a global namespace
Inclusion order must be manually calculated
–browserify.org
“Browserify lets you require('modules') in the browser
by bundling up all of your dependencies.”
Module management with browserify
Modules are scoped in their own namespace
Uses CommonJS standard interface
Dependencies defined using require function
Modules are defined by assigning an object to module.exports
Exactly like node.js
var $ = require(‘jquery’),
_ = require(‘underscore’),
MyModel = require(‘../models/MyModel’);
main.js
Where to from here?
Detailed documentation: http://bit.ly/1kbozFB
grunt-browserify: wrapper for integration into Grunt build with other tools, like uglify.
exorcist: extract source maps for browsers. Very useful, terrible name.
watchify: CLI file watcher for performing automatic builds during development.