browsersync.js 761 字节
Newer Older
1 2 3 4 5 6 7
/*
 * Tabler (v0.9.0): browsersync.js
 * Copyright 2018-2019 The Tabler Authors
 * Copyright 2018-2019 codecalm
 * Licensed under MIT (https://github.com/tabler/tabler/blob/master/LICENSE)
 */

C
chomik 已提交
8 9 10 11 12 13
const bs = require('browser-sync').create();

bs.init({
  watch: true,
  server: {
    routes: {
C
chomik 已提交
14
      '/': 'tmp',
C
codecalm 已提交
15
      '/dist': 'tmp-dist',
C
chomik 已提交
16 17
      '/libs': 'static/libs',
      '/img': 'static/img',
C
codecalm 已提交
18
      '/node_modules': 'node_modules',
D
Damian Sznajder 已提交
19
    },
C
chomik 已提交
20
  },
C
codecalm 已提交
21
  files: ['tmp/**/*', 'tmp-dist/css/*.css', 'tmp-dist/js/*.js'],
C
chomik 已提交
22
  watchOptions: {
D
Damian Sznajder 已提交
23
    ignoreInitial: true,
C
chomik 已提交
24
  },
25
  reloadDelay: 1000,
D
Damian Sznajder 已提交
26
  notify: false,
27 28 29 30 31 32 33 34 35
  open: false,
  snippetOptions: {
    rule: {
      match: /<\/head>/i,
      fn: function (snippet, match) {
        return snippet + match;
      }
    }
  }
C
chomik 已提交
36
});