0

当我运行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');

});

我已经用 node npm 正确安装了这个包。

在此处输入图像描述

有什么问题?

4

0 回答 0