Skip to content

Commit

Permalink
add optional host and port overrides for browsersync
Browse files Browse the repository at this point in the history
  • Loading branch information
dwalkr committed Apr 30, 2019
1 parent eb6936f commit ffef5b3
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions .browsersyncrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,23 @@ dotenv.config()

export default function(env) {
const gulpConfig = GulpConfig()
const isProduction = (env === "production") || (process.env.NODE_ENV === "production")
const isProduction =
env === "production" || process.env.NODE_ENV === "production"
const host = process.env.PREVIEW_IP || null
const port = process.env.PREVIEW_PORT || 3000

return {
"server": {
"baseDir": [gulpConfig.tmp, gulpConfig.build],
"middleware": isProduction ? [require("compression")()] : []
server: {
baseDir: [gulpConfig.tmp, gulpConfig.build],
middleware: isProduction ? [require("compression")()] : []
},
"https": false,
"injectChanges": true,
"notify": true,
"open": false,
"port": 3000,
"reloadThrottle": 300,
"reloadDelay": 300
https: false,
injectChanges: true,
notify: true,
open: false,
port: port,
host: host,
reloadThrottle: 300,
reloadDelay: 300
}
}

0 comments on commit ffef5b3

Please sign in to comment.