laravel-elixir - elixir.config.js未定义

时间:2015-08-24 21:34:09

标签: laravel-elixir

我试图将reactify变换器添加到browserfy:

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

elixir.config.js.browserify.transformers.push({
    name: 'reactify',
    options: {}
});

elixir(function(mix) {
    mix.sass('app.scss');
    mix.browserify('App.js');
});

我收到此错误:

TypeError: Cannot read property 'browserify' of undefined
at Object.<anonymous> (/Users/carlo/Dev/jscomix/gulpfile.js:15:17)
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 (/usr/local/lib/node_modules/gulp/bin/gulp.js:116:3)
at Liftoff.<anonymous> (/usr/local/lib/node_modules/gulp/node_modules/liftoff/index.js:192:16)
at module.exports (/usr/local/lib/node_modules/gulp/node_modules/liftoff/node_modules/flagged-respawn/index.js:17:3)

似乎未设置config变量。任何人都可以在代码中看到任何错误吗?

1 个答案:

答案 0 :(得分:0)

对于遇到此问题的任何人,问题是旧的elixir版本(2.0.0),它在3.0.0版本中正常运行