亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Laravel: How to use browserSync() in elixir?
習(xí)慣沉默
習(xí)慣沉默 2017-05-16 16:50:15
0
1
586

The following is gulpfile.js:

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

elixir(function(mix) {
    mix.compass(['app.scss', 'controllers.scss']).version('css/app.css');
    mix.scripts(['jquery.js','app.js']).version('js/all.js');
});

Question:
I want to add browserSync() to gulpfile.js, how should I write it?
The document is as follows, but it needs to be added to the above code, and I don’t know how to do it.

elixir(function(mix) {
    mix.browserSync({ 
       proxy: 'project.app'
    });
});
習(xí)慣沉默
習(xí)慣沉默

reply all(1)
阿神

Just like the official website, add that to your task. Of course, the example settings on the official website are relatively simple. In fact, other settings should go to browser-sync的官網(wǎng)看看的(看下它的gulpConfiguration Example). You can refer to my configuration below:

gulpfile.js

elixir(function(mix) {
    mix.sass('./resources/assets/sass/**/*.scss','public/dist/css/app.css');

    mix.browserify('index.js', 'public/dist/js/build-index.js');

    // 實(shí)時(shí)監(jiān)聽文件
    mix.browserSync({
        proxy: '192.168.0.112',   // apache或iis等代理地址
        port: 3000,
        notify: false,        // 刷新是否提示
        watchTask: true,
        open: 'external',
        host: '192.168.0.112',  // 本機(jī)ip, 這樣其他設(shè)備才可實(shí)時(shí)看到更新
    });

});

You can read these two notes, which may be helpful for your understanding:
browser-sync configuration
laravel-elixir configuration

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template