Laravel Elixir不工作

时间:2015-04-21 12:38:04

标签: php laravel laravel-5 laravel-elixir

我有一些样式表和一些管理面板和公共文件的脚本。我想用laravel elixir编译。

但不行。只需编译管理样式和脚本。我怎么能两个都做?

这是我的代码:

    var elixir = require('laravel-elixir');

/*
 |--------------------------------------------------------------------------
 | Elixir Asset Management
 |--------------------------------------------------------------------------
 |
 | Elixir provides a clean, fluent API for defining some basic Gulp tasks
 | for your Laravel application. By default, we are compiling the Less
 | file for our application, as well as publishing vendor resources.
 |
 */

elixir(function(mix) {
    mix.styles([
        'style.css',
        'select2.min.css',
        'redactor2.css',
        'custom.css'
        ], 'public/css/admin.css', 'resources/assets/css' )
    .styles([
        'css/bootstrap.css',
        'css/bootstrap-responsive.css',
        'css/jquery.smarticker.min.css',
        'css/fancybox/jquery.fancybox.css',
        'css/fancybox/helpers/jquery.fancybox-buttons.css',
        'css/fancybox/helpers/jquery.fancybox-thumbs.css',
        'css/pstyle.css'
        ], 'public/css/public.css', 'resources/assets/css' );

    mix.scripts([
        'jquery.tools.min.js',
        'jquery-2.1.3.min.js',
        'jquery.leanModal.min.js',
        'jquery.form.js',
        'select2.min.js',
        'redactor2.js',
        'script.js',
        'plugin/fontcolor.js',
        'plugin/fontsize.js',
        'plugin/imagemanager.js',
        'plugin/table.js',
        'plugin/video.js'
    ], 'public/js/admin.js', 'resources/assets/js' )

    .scripts([
        'js/jquery.smarticker.min.js',
        'js/fancybox/jquery.mousewheel-3.0.6.pack.js',
        'js/fancybox/jquery.fancybox.js',
        'js/fancybox/helpers/jquery.fancybox-buttons.js',
        'js/fancybox/helpers/jquery.fancybox-thumbs.js',
        'js/fancybox/helpers/jquery.fancybox-media.js',
        'js/bootstrap.min.js',
        'js/jquery.slimscroll.min.js',
        'js/bootstrap.dropdown.min.js',
        'js/jquery-ui-1.9.1.custom.min.js',
        'js/public.js'
    ], 'public/js/public.js', 'resources/assets/js' );

    mix.version(['public/css/admin.css','public/css/public.css','public/js/admin.js','public/css/public.js']);
});

2 个答案:

答案 0 :(得分:0)

尝试在cmd中运行:

gulp --production && gulp version --production

对流浪家园也有同样的错误。不能版本多个js / css,必须运行gulp版本--production

答案 1 :(得分:0)

我得到了解决方案。我的脚本犯了一个错误。请检查http://laravel.io/bin/6LVEj

感谢大家的回答