1

i am following the laracasts tutorial,

Over there they had no error during tutorial, But when i am trying to run gulp command i get error

c:\xampp\htdocs\projects\ims>gulp
c:\xampp\htdocs\projects\ims\gulpfile.js:16
        .publish(
         ^
TypeError: undefined is not a function
    at c:\xampp\htdocs\projects\ims\gulpfile.js:16:10
    at Elixir (c:\xampp\htdocs\projects\ims\node_modules\laravel-elixir\index.js:3:5)
    at Object.<anonymous> (c:\xampp\htdocs\projects\ims\gulpfile.js:14:1)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Liftoff.handleArguments (C:\Users\sizzling\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:116:3)

Here is my gulp file

elixir(function(mix) {
    mix.less('app.less')
        .publish(
        'jquery/dist/jquery.min.js',
        'public/js/vendor/jquery.js'
    )
        .publish(
        'bootstrap/dist/js/bootstrap.min.js',
        'public/js/vendor/bootstrap.js'
    )
        .publish(
        'font-awesome/css/font-awesome.min.css',
        'public/css/vendor/font-awesome.css'
    )
        .publish(
        'font-awesome/fonts',
        'public/css/fonts'
    );
});

i know i must have done someway wrong but can't find out where did i go wrong? Any Help would be appreciated.

4

1 回答 1

4

.publish()函数是已设置凉亭路径的别名.copy(),但它已被删除,因此您需要使用.copy(). 像这样的东西应该工作

.copy(
    mix.bowerDir + '/path/to/lib/lib.js',
    'public/js/lib.js'
);

https://github.com/laravel/elixir/commit/b6d59b9f68978224064964a75a7639f95aa2eeee

于 2015-04-20T07:53:53.737 回答