@@ -8,11 +8,20 @@ import paths from '../mconfig.json';
|
|||||||
import bs from 'browser-sync';
|
import bs from 'browser-sync';
|
||||||
|
|
||||||
// Start the Browsersync server
|
// Start the Browsersync server
|
||||||
bs.init({
|
let bsConfig = {
|
||||||
proxy: paths.url,
|
|
||||||
open: false,
|
open: false,
|
||||||
notify: false
|
notify: false
|
||||||
});
|
};
|
||||||
|
|
||||||
|
if (typeof paths.proxy === 'string' && paths.proxy.length > 0) {
|
||||||
|
// Use proxy
|
||||||
|
bsConfig.proxy = paths.proxy;
|
||||||
|
} else {
|
||||||
|
// Use base directory
|
||||||
|
bsConfig.server = { baseDir: paths.dest };
|
||||||
|
}
|
||||||
|
|
||||||
|
bs.init(bsConfig);
|
||||||
|
|
||||||
// Build scripts, compile styles, concat vendors and generate the svgs sprite on first hit
|
// Build scripts, compile styles, concat vendors and generate the svgs sprite on first hit
|
||||||
buildScripts();
|
buildScripts();
|
||||||
@@ -31,7 +40,7 @@ bs.watch(
|
|||||||
]
|
]
|
||||||
).on('change', bs.reload);
|
).on('change', bs.reload);
|
||||||
|
|
||||||
// Watch scripts
|
// Watch scripts
|
||||||
bs.watch(
|
bs.watch(
|
||||||
[
|
[
|
||||||
paths.scripts.src + '**/*.js'
|
paths.scripts.src + '**/*.js'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"url": "locomotive-boilerplate.test",
|
"proxy": "",
|
||||||
"src": "./assets/",
|
"src": "./assets/",
|
||||||
"dest": "./www/",
|
"dest": "./www/",
|
||||||
"build": "./build/",
|
"build": "./build/",
|
||||||
|
|||||||
Reference in New Issue
Block a user