-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverInit.js
35 lines (35 loc) · 947 Bytes
/
serverInit.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import fileMap from './filemap.js'
import browserSync from 'browser-sync'
//* https://browsersync.io/docs/options
//! STATIC = HTML CSS JS
const isStaticServer = false
let initTask
if (isStaticServer)
{
initTask = () =>
browserSync.init({
notify: false,
reloadOnRestart: true,
server : {
//* use for debug
// directory: true,
//* to serve multiple roots
baseDir: [`${fileMap.build.pages}`, `${fileMap.build.folder}`],
serveStaticOptions: {
extensions: ['html']
},
routes: {
//* relative path from gulpfile
// "/bower_components": "bower_components"
}
}
})
}
else
{
initTask = () =>
browserSync.init({
proxy: 'gulp-dev-env.com',
})
}
export default initTask