Skip to content

Commit

Permalink
Fixed, issue moff#2 BrowserSync not reloading changes
Browse files Browse the repository at this point in the history
Fixed, reduced unnecessary processes in dev-building so that gulp build could be faster
  • Loading branch information
Song myoungki committed Dec 9, 2016
1 parent 122572f commit 06938a8
Showing 1 changed file with 27 additions and 17 deletions.
44 changes: 27 additions & 17 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ var elixir = require('laravel-elixir');
var webpack = require('webpack')
require('laravel-elixir-webpack-ex');

var isProduction = elixir.config.production;

/*
|--------------------------------------------------------------------------
| Elixir Asset Management
Expand Down Expand Up @@ -70,27 +72,35 @@ elixir(function(mix) {
'resources/assets/typescript'
);

mix.version([
'css/app.css',
var versioningFile = [
'css/app.css',
'js/app.js',
'js/vendor.js',
'js/all.js',
'css/all.css'
]);

mix.scripts([
'vendor.js',
'app.js'
], 'public/js/all.js', 'public/js');

mix.styles([
'app.css'
], 'public/css/all.css', 'public/css');
'js/vendor.js'
];

// run only if gulp --production
if (isProduction) {
versioningFile = versioningFile.concat([
'js/all.js',
'css/all.css'
]);

mix.scripts([
'vendor.js',
'app.js'
], 'public/js/all.js', 'public/js');

mix.styles([
'app.css'
], 'public/css/all.css', 'public/css');
}

mix.version(versioningFile);

mix.browserSync({
files: [
"public/js/*",
"public/css/*"
"public/build/js/*",
"public/build/css/*"
],
proxy: "localhost:8000"
});
Expand Down

0 comments on commit 06938a8

Please sign in to comment.