吞咽不看所有任务
Gulp not watching all tasks
我试图将我的 SASS 编译为 CSS,但我的 gulp 只在第一个任务上观看 - 哪里不好?
古尔普文件.js
var gulp = require('gulp');
var sass = require('gulp-sass');
gulp.task('styles', function() {
gulp.src('sass/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./css/'));
});
gulp.task('bootstrap', function() {
gulp.src('sass/bootstrap/bootstrap.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./plugins/bootstrap/css/'));
});
gulp.task('default',function() {
gulp.watch('sass/*.scss',['styles']);
gulp.watch('sass/bootstrap/*.scss',['bootstrap']);
});
我的文件结构:
assets
-- css/
---- style.css
-- node_modules/
---- (files from node)
-- sass/
---- bootstrap/
------- (parts of bootstrap)
---- bootstrap.scss
---- style.scss
-- gulpfile.js
-- package.json
我要编译:
assets/sass/style.scss -> assets/css/style.css
assets/sass/bootstrap.scss -> assets/plugins/bootstrap/css/bootstrap.min.css
您是否尝试过将默认值更改为关注?
gulp.task('styleswatch', function() {
gulp.watch('sass/*.scss',['styles']);
}
gulp.task('bootstrapwatch', function() {
gulp.watch('sass/*.scss',['bootstrap']);
}
gulp.task('default',['styleswatch','bootstrapwatch']);
相关文章:
- Steam Web API:I'我不知道该如何处理这个看起来像哈希的url来生成图像
- 如果助手不在,如何从Grunt中的代码中调用任务
- 为什么我在Internet Explorer上看不到html元素
- ajax请求成功,但可以'我看不到我的数据
- 使用jQuery for RSS看不到多个帖子
- Grunt不看JS文件
- Node.js异步并行“;类型错误:任务不是函数;
- Grunt Copy任务不复制父文件夹's文件保存到正确的文件夹中
- j查询指定任务不起作用
- 咕噜咕噜地看着不运行任务
- Gulp+Browserify任务不工作(没有输出)
- Gulp任务不同步工作
- 任务不可能:jQuery属性选择器
- 耙任务不起作用的自毁功能
- 是否可以通过AJAX调用执行后台PHP服务器任务,该任务不会锁定您的网站
- Grunt手表任务不起作用
- 在gulpfile.js中传递参数给Gulp任务(不是命令行)
- Gulp任务不会退出
- 吞咽不看所有任务
- “套接字”类型错误上缺少错误处理程序:任务不是函数 - 节点.js异步.js