-
-
Save anonymous/71c5505c55ad70c7db6933085511e069 to your computer and use it in GitHub Desktop.
This file contains 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
function libraries(dev) | |
{ | |
let libraries = bowerMainFiles( // из bower/%package%/bower.json | |
{ | |
overrides: {} // все поправки к bower.json::main | |
}) | |
.concat([]) // прочие, проблемные, библиотеки | |
if(!dev) | |
libraries = libraries.map(p => | |
{ | |
const min = p.replace(/.js$/, '.min.js'); | |
return fileExists(min) ? min : p; | |
}); | |
return gulp | |
.src(libraries) | |
.pipe(rename(path => | |
{ | |
path.dirname = ''; // лишняя иерархия | |
path.basename = _.kebabCase(path.basename) // унификация названий | |
.replace('-min', ''); // так проще подключать | |
})) | |
// при желании можно будет подключить минификатор | |
.pipe(gulp.dest(`${WWW_DIR}/js/lib`)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment