Skip to content

Instantly share code, notes, and snippets.

@mkuklis
Created December 6, 2012 16:56
Show Gist options
  • Save mkuklis/4226014 to your computer and use it in GitHub Desktop.
Save mkuklis/4226014 to your computer and use it in GitHub Desktop.
approach to client-side modules
// modules (one per file)
(function (namespace) {
"use strict";
// implementation
})(namespace);
// files.js (loaded in dev)
(function (namespace) {
namespace.files = [
'module1',
'module2',
...
'moduleN'];
})(namespace);
// init.js (in dev)
// https://github.com/ded/script.js/
$script.order(namespace.files);
// in prod use grunt tasks to prepare for release (concat, min, etc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment