Created
January 18, 2015 09:04
-
-
Save alissonbovenzo/87c670fca368ee4ab981 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
gulp.task('dist',function(){ | |
fs.readFile('./app/index.html', {encoding: 'utf-8'} ,function (err, data){ | |
//pega todos as dependencias vindas do bower | |
var patternBower = /(bower.+js)/g | |
, appPath = 'app/' | |
, bowerDependencys = data.match(patternBower); | |
for(var i = bowerDependencys.length -1 ; i ; i--){ | |
var srcPath = appPath + bowerDependencys[i] | |
, destPath = appPath + 'js/vendor/' | |
, archiveName = bowerDependencys[i].split('/').reverse()[0]; | |
fs.writeFileSync(destPath + archiveName, fs.readFileSync(appPath+bowerDependencys[i])); // copia de arquivos sincrona | |
} | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment