当我运行 gulp critical 命令时,elixir会暂停加载一段时间,然后在控制台中出错:
var elixir = require('laravel-elixir');
var BrowserSync = require('laravel-elixir-browsersync');
var gulp = require('gulp');
var critical = require('critical');
gulp.task('critical', function() {
critical.generate({
src: 'http://regalospersonales.local',
css: 'public/css/style.css',
width: 1280,
height: 600,
dest: 'public/css/critical.css'
});
});
elixir(function(mix) {
BrowserSync.init();
mix.BrowserSync(
{
proxy : "regalospersonales.local",
logPrefix : "Laravel Eixir BrowserSync",
logConnections : false,
reloadOnRestart : false,
notify : false,
files : ["app/**/*",
"public/**/*",
"resources/views/**/*",
]
});
mix.sass([
"main.scss",
],'public/css/style.css');
mix.task('critical');
});
我已经使用节点npm正确安装了包。
问题是什么?