我可以用Aglio重新加载样式、模板和变量吗?
Can I live reload styles, templates, and variables with Aglio?
我无法使用Aglio的--server
选项或gulp
与connect
的livereload
选项和gulp-aglio
插件配对来实时加载LESS和Jade文件。
这是由于缓存吗?还是connect
的实时装填能力受到限制?
使我的更改呈现的唯一方法是ctrl-C并再次运行gulp。
这是我的gulpfile.js:
var
gulp = require('gulp'),
aglio = require('gulp-aglio'),
connect = require('gulp-connect'),
plumber = require('gulp-plumber'),
watch = require('gulp-watch')
;
gulp.task('docs', function(){
gulp
.src('docs/index.apib')
.pipe(plumber())
.pipe(aglio({
themeTemplate: 'docs/templates/triple.jade',
themeStyle: 'docs/styles/layout-default.less',
themeVariables: 'docs/styles/variables-default.less',
themeFullWidth: true
}))
.pipe(gulp.dest('docs'))
;
});
gulp.task('server', function(){
connect.server({
livereload: true,
root: ['docs']
});
});
gulp.task('livereload', ['docs'], function(){
gulp
.src(['docs/*.apib'])
.pipe(plumber())
.pipe(connect.reload())
;
});
gulp.task('watch', function() {
gulp.watch(['docs/*.apib', 'docs/*.md', 'docs/styles/*.less', 'docs/templates/*.jade'], ['docs', 'livereload']);
})
gulp.task('default', ['docs', 'server', 'livereload', 'watch']);
gulp.task('build', ['docs']);
这目前是不可能的。肝脏加载功能仅用于重新加载输入API Blueprint文件。所有的主题文件都是缓存的,所以它们只被加载一次。
问题:这个特性的用例是什么?
相关文章:
- 连接变量,在我的情况下背景样式损坏
- 记事本++ Javascript格式样式和变量列表
- 无法“替换”样式“中的内容 - 其中”html“存储在变量中
- 将样式值设置为Javascript变量
- 在样式标记上插入变量
- 将attr样式存储在变量中
- 如何分离javaScript变量's整数和它's decimal以分别设置样式
- 需要一些有关以以下样式声明变量的信息
- 使用 JavaScript 变量在 JQuery 中设置样式
- 使用变量引用样式属性
- 来自指令的角度范围变量未以 ng 样式同步
- 在 jquery 中从日期中减去变量(倒计时样式)
- 如何在 CSS 样式中使用 PHP 变量
- 将变量附加到jquery中的样式
- 带有变量的javascript样式
- javascript样式-我应该定义变量/类吗
- 基于javascript中的会话变量设置特定的样式表
- 将变量传递给LESS.js样式表
- 如何使用“样式”中的变量标签
- 如何在js中使用样式标签使用变量