Last active
December 13, 2015 18:19
-
-
Save serby/4954541 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var jade = require('jade') | |
| , browserify = require('browserify') | |
| , fs = require('fs') | |
| module.exports = function (inputFile, outputFile, options) { | |
| var b = browserify(options) | |
| b.register('.jade', function (body, file) { | |
| var options = { client: true, compileDebug: true, filename: file } | |
| body = 'module.exports = ' + jade.compile(body, options).toString() + ';' | |
| return body | |
| }) | |
| b.prepend(fs.readFileSync(__dirname + '/../../../node_modules/jade/runtime.js', 'utf8')) | |
| b.addEntry(inputFile) | |
| fs.writeFileSync(outputFile, b.bundle()) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var browjadify = require('./pliers-helpers/browjadify') | |
| , join = require('path').join | |
| module.exports = function (pliers) { | |
| pliers('clean', function (done) { | |
| pliers.rm(join(__dirname, 'public', 'js', 'build')) | |
| done() | |
| }) | |
| pliers('buildBrowserJs', 'clean', function (done) { | |
| pliers.mkdirp(join(__dirname, 'public', 'js', 'build')) | |
| browjadify(join(__dirname, 'public', 'js', 'app', 'index.js'), | |
| join(__dirname, 'public', 'js', 'build', 'app.js'), { debug: true }) | |
| done() | |
| }) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment