can-compile
Advanced tools
Comparing version 0.5.0 to 0.6.0
@@ -52,2 +52,2 @@ 'use strict'; | ||
module.exports.compile = compiler; | ||
module.exports.compile = compiler; |
{ | ||
"name": "can-compile", | ||
"description": "Compile CanJS Mustache and EJS views for lightning fast production apps", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"homepage": "http://daffl.github.com/can-compile", | ||
@@ -36,3 +36,4 @@ "author": { | ||
"grunt-release": "~0.5.1", | ||
"grunt-simple-mocha": "~0.4.0" | ||
"grunt-simple-mocha": "~0.4.0", | ||
"glob": "~3.2.8" | ||
}, | ||
@@ -39,0 +40,0 @@ "dependencies": { |
@@ -87,5 +87,43 @@ # can-compile | ||
## Gulp task | ||
It is also quite easy to get this up and running with your production build using Gulp. By placing the following example in your gulpfile.js, all mustache templates in the client/app directory will be compiled into a file at public/assets/views.production.js. | ||
```javascript | ||
var gulp = require('gulp'), | ||
compilerGulp = require('can-compile/gulp.js'); | ||
var options = { | ||
src: ['client/app/**/*.mustache'], | ||
out: 'public/assets/views.production.js', | ||
tags: ['editor', 'my-component'] | ||
}; | ||
// Creates a task called 'app-views'. Must pass in same gulp instance. | ||
compilerGulp.task('app-views', options, gulp); | ||
// Creates a task called 'app-views-watch'. Optional, but convenient. | ||
compilerGulp.watch('app-views', options, gulp); | ||
// The default task (called when you run `gulp` from cli) | ||
gulp.task('default', [ | ||
'app-views', | ||
'app-views-watch' | ||
]); | ||
``` | ||
You'll need gulp installed globally and locally: | ||
sudo npm install gulp -g | ||
npm install gulp | ||
And a local copy of can-compile | ||
npm install can-compile | ||
Run `gulp` in the command line to build. | ||
## Programmatically | ||
You can compie files directly like this: | ||
You can compile individual files directly like this: | ||
@@ -169,2 +207,6 @@ ```javascript | ||
__0.6.0:__ | ||
- Added Gulp task ([#16](https://github.com/daffl/can-compile/pull/16), [#17](https://github.com/daffl/can-compile/pull/17), [#18](https://github.com/daffl/can-compile/pull/18)) | ||
__0.5.0:__ | ||
@@ -171,0 +213,0 @@ |
Sorry, the diff of this file is not supported yet
5157
248
257963
8
30