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'
});
});
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
的官网看看的(看下它的gulp
Configuration Example). You can refer to my configuration below:You can read these two notes, which may be helpful for your understanding:
browser-sync configuration
laravel-elixir configuration