GulpJS流构建系统
从头编写HTML\CSS\Javascript是上个世纪的事情了,如今的JavaScript都是通过CoffeeScript这样的支持句法缩写的编辑器写成的。如果你希望写完JavaScript能够一个工具完成代码清理优化工作,Gulp 就是你的不二之选,GulpJS类似Ant或Maven之于Java。
示例代码:
var gulp = require('gulp'); var coffee = require('gulp-coffee'); var concat = require('gulp-concat'); var uglify = require('gulp-uglify'); var imagemin = require('gulp-imagemin'); var sourcemaps = require('gulp-sourcemaps'); var del = require('del'); var paths = { scripts: ['client/js/**/*.coffee', '!client/external/**/*.coffee'], images: 'client/img/**/*' }; // Not all tasks need to use streams // A gulpfile is just another node program and you can use all packages available on npm gulp.task('clean', function(cb) { // You can use multiple globbing patterns as you would with `gulp.src` del(['build'], cb); }); gulp.task('scripts', ['clean'], function() { // Minify and copy all JavaScript (except vendor scripts) // with sourcemaps all the way down return gulp.src(paths.scripts) .pipe(sourcemaps.init()) .pipe(coffee()) .pipe(uglify()) .pipe(concat('all.min.js')) .pipe(sourcemaps.write()) .pipe(gulp.dest('build/js')); }); // Copy all static images gulp.task('images', ['clean'], function() { return gulp.src(paths.images) // Pass in options to the task .pipe(imagemin({optimizationLevel: 5})) .pipe(gulp.dest('build/img')); }); // Rerun the task when a file changes gulp.task('watch', function() { gulp.watch(paths.scripts, ['scripts']); gulp.watch(paths.images, ['images']); }); // The default task (called when you run `gulp` from cli) gulp.task('default', ['watch', 'scripts', 'images']);
评论
GulpJS流构建系统
从头编写HTML\CSS\Javascript是上个世纪的事情了,如今的JavaScript都是通过CoffeeScript这样的支持句法缩写的编辑器写成的。如果你希望写完JavaScript能够一个
GulpJS流构建系统
0
Angular Kickstart基于 GulpJS 的构建系统
Angular Kickstart 是基于 AngularJS,GulpJS 和 Bower 的完整
Angular Kickstart基于 GulpJS 的构建系统
0
Angular Kickstart基于 GulpJS 的构建系统
AngularKickstart是基于AngularJS,GulpJS和Bower的完整可伸缩构建系统,能加快AngularJS应用的开发。开发者只需关注代码的编写和测试,剩下的工作AngularJS
Angular Kickstart基于 GulpJS 的构建系统
0
Meson构建系统
Meson旨在开发最具可用性和快速的构建系统。提供简单但强大的声明式语言用来描述构建。原生支持最新的工具和框架,如Qt5、代码覆盖率、单元测试和预编译头文件等。利用一组优化技术来快速变异代码,包括增量
Meson构建系统
0
Blueprint构建系统
Blueprint是一个元构建系统,它可在Blueprints文件下阅读所需要建立的模块的描述,同时产出一个用于描述所需的命令行的Ninja清单。大多数构建系统用内置规则或者特定领域的语言来描述用于转
Blueprint构建系统
0
Ekam构建系统
Ekam(“make”的倒写)是一个构建系统,它能自动计算出如何在纯源代码中建立系统,并且不需要独立的makefile。Ekam通过搜索的方式工作。当遇见以“.cpp”结尾的文件时,它会编译此文件,拦
Ekam构建系统
0