0.2.0 • Published 9 years ago

ccjs v0.2.0

Weekly downloads
9
License
MIT
Repository
github
Last release
9 years ago

ccjs

client-side common js

how does it work

  • it will be used as a middlare(described below) inside your connect based application(e.g. express)
  • when the browser make a request to the server asking for a js file, the original js file will be read from disk, and all dependencies of that file get bundled and sent to browser
  • for performance consideration, the js file need to be pre-bundled for deployment, this can be done using grunt-ccjs

limitations

  • only works with packages that has little to do with node, like jquery and lodash
  • require takes place on the server side, so dynamic require won't work

usage

using the middleware

see tests/server.js

var path = require('path');
var ccjs = require('ccjs').middleware;

app.use(ccjs({root:path.join(__dirname, '/public/js')}));
<script src="main.js?commonjs=1"></script>

coffeescript

npm install --save coffee-script
app.use ccjs
	root: path.join __dirname, '/public/js'
	coffee: on

grunt plugin

0.2.0

9 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago