我一直在使用gulp-watch.当前版本的gulp-watch依赖于调用gulp.parrallel.此通话仅适用于gulp 4.
但是通过npm repo无法获得gulp 4.
npm info gulp dist-tags回报:{ latest: '3.9.0' }.
我可以看到git repo中有一个4.0分支.但尝试使用此命令的变体安装它失败:npm install https://github.com/gulpjs/gulp#v4.0.0.
我想将布局拆分为部分.
我正在创建默认的刀片布局.
该文件名为default.blade.php,位于该layout文件夹中.
在布局文件夹下也是include.在这个目录中,我有head.blade.php
我想从'默认'中调用'head'.
其中每个都失败并在打开调试时返回错误:
@include('include/head'), @include('include/head.blade.php'), @include('include/head.blade.php')
Run Code Online (Sandbox Code Playgroud)
我已将head.blade.php复制到default.blade.php 所在的文件夹中,但仍然出错.
我想在我的工具包中添加gulp,sass和browsersync.我现在正在运行gulp并配置了sass和browsersync任务.
我正在为我的本地apache服务器上的vhost运行一个php应用程序.
我正在尝试从watch任务运行browsersync,使用browsersync的代理选项来使用我的vhost.
目前,当我运行手表时,没有服务器可以在端口3000上找到.如果我导航到'localhost:3000'我得到chromes'没有找到网页'消息.
如果我导航到端口3001,我可以访问browsersync的管理UI.所以我知道browsersync正在运行.
我的口号如下
/* load plugins */
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
browsersync = require('browser-sync') ;
/*
* define tasks
*/
gulp.task('sass', function() {
return sass('assets/sass/main.sass') ;
}) ;
/*
* browsersync conf
*/
gulp.task('browser-sync', function() {
browsersync({
proxy: 'localhost',
port: '3000'
});
});
gulp.task('browsersync-reload', function () {
browsersync.reload();
});
gulp.task('watch', ['browser-sync'], function () {
gulp.watch('assets/sass/**/*', ['css']);
});
/* Default task */
gulp.task('default', ['sass'], function() {
gulp.watch("assets/sass/**.*", ['sass']);
});
Run Code Online (Sandbox Code Playgroud)