How to use the getOption function from browser-sync

Find comprehensive JavaScript browser-sync.getOption code examples handpicked from public code repositorys.

21
22
23
24
25
26
27
28
29
30
// reloadOnRestart: true,
// logLevel: process.env.NODE_ENV !== 'production' ? 'debug' : '',
callbacks: {
  ready: () => {
    try {
      PROXY_SERVER_URL = bs.getOption('urls').get('local') // Options: local, external, ui, ui-external

      resolve({
        site: SITE_URL,
        proxy: PROXY_SERVER_URL
fork icon1
star icon33
watch icon4

391
392
393
394
395
396
397
398
399
400
401
402
  startPath: webConfig.CURRENT_DIR
}


const browserSyncCallbacks = (err, bs) => {
  // サーバー URL 取得
  const baseURL = bs.getOption('urls');
  const localURL = url.parse(baseURL.get('local', false));
  const externalURL = url.parse(baseURL.get('external', false));


  // API サーバー起動のログ出力
fork icon0
star icon6
watch icon1

+ 3 other calls in file

260
261
262
263
264
265
266
267
268
269
  } else {
    url = siteSetting.siteDomainProduction
    fullurl = siteSetting.siteDomainProduction
  }
} else if (browserSync.active === true) {
  url = browserSync.getOption('urls').get('external') + '/'
  fullurl = browserSync.getOption('urls').get('external') + '/'
} else {
  url = '/'
  fullurl = '/'
fork icon0
star icon0
watch icon1

+ 7 other calls in file

209
210
211
212
213
214
215
216
217
218
  }
}

function output() {
  const localUrl = browserSync.getOption('urls').get('local');
  const externalUrl = browserSync.getOption('urls').get('external');

  console.log('\nAccess URLs:');
  console.log('     Local:', $.util.colors.magenta(localUrl));
  console.log('  External:', $.util.colors.magenta(externalUrl));
fork icon0
star icon0
watch icon0

+ 3 other calls in file

79
80
81
82
83
84
85
86
87
88
89
90
  ui: false,
};


server.info = function() {
  const host = server.getOption('proxy').get('target');
  const port = server.getOption('port');
  const proxying = `${host}:${port}`;
  const external = server.getOption('urls').get('external');


  console.clear();
fork icon0
star icon0
watch icon0

+ 5 other calls in file

563
564
565
566
567
568
569
570
571
572
];

bsSP.use(require('../modules/browser-sync/screen-message'));

bsSP.init(settings.app.bsSP, () => {
  // let urls = bsSP.getOption('urls');
  // let bsAuth = bsSP.getOption('bsAuth');
  // let authString = '';

  // if (bsAuth && bsAuth.use) {
fork icon0
star icon0
watch icon0