Created
May 23, 2016 09:45
-
-
Save JiLiZART/126a9c60b8445d15c9b491d0ff80617d to your computer and use it in GitHub Desktop.
enb-exports-file.js
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 fs = require('enb/lib/fs/async-fs'), | |
vow = require('vow'), | |
path = require('path'); | |
module.exports = require('enb/lib/build-flow').create() | |
.name('enb-exports-file') | |
.target('target', '?.js') | |
.useSourceFilename('source', '?.txt') | |
.builder(function(cssFilename) { | |
var def = vow.defer(); | |
return fs.read(cssFilename, 'utf8') | |
.then(function(data) { | |
var file = "module.exports = '" + data.replace(/\'/g,"\\'") + "';"; | |
def.resolve(file); | |
return def.promise(); | |
}); | |
}) | |
.createTech(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment