简体   繁体   English

在laravel应用中使用纯gulp而不是elixir

[英]Use pure gulp instead of elixir in laravel application

I'm very new with laravel, previously I was on node.js mostly. 我是laravel的新人,以前我主要是在node.js上。

We use react with laravel in a new project. 我们在新项目中使用laravel做出反应。 I'm confused when I saw this file https://github.com/eriksape/laravel-react-hot-loader/blob/master/gulpfile.js 当我看到这个文件时,我很困惑https://github.com/eriksape/laravel-react-hot-loader/blob/master/gulpfile.js

Why use elixir in gulpfile.js? 为什么在gulpfile.js中使用elixir? I thought we can do the gulp way like 我以为我们可以这样做

gulp.task('watch', function() {
    browserSync({ 
        proxy: 'localhost:8000',
        middleware: [
        webpackDevMiddleware(bundler, {
          publicPath: webpackConfig.output.publicPath,

          stats: { colors: true }

        }),

        webpackHotMiddleware(bundler)
      ]
    });
}); 

But I did tried to use pure gulp, the hot reloading did not work, webpack will bundle everything from scratch again. 但我确实尝试使用纯gulp,热重装不起作用,webpack将从头开始捆绑所有东西。 I wonder what role does elixir is doing here. 我想知道elixir在这里扮演的角色是什么。

If you don't use Elixir, then you don't have to worry about anything. 如果你不使用Elixir,那么你不必担心任何事情。

Just remove references to it and ad your gulp dependencies in your package.json file, and then execute gulp as you would normally. 只需删除对它的引用并在package.json文件中添加gulp依赖项,然后gulp执行gulp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM