browsersync.js 566 字节
Newer Older
C
chomik 已提交
1 2 3
const bs = require('browser-sync').create();

bs.init({
C
codecalm 已提交
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
	watch: true,
	server: {
		routes: {
			'/': 'tmp',
			'/dist': 'tmp-dist',
			'/libs': 'static/libs',
			'/tmp-dist/img': 'img',
			'/static': 'static',
			'/node_modules': 'node_modules',
		},
	},
	files: ['tmp/**/*', 'tmp-dist/css/*.css', 'tmp-dist/js/*.js', 'tmp-dist/img/*.svg'],
	watchOptions: {
		ignoreInitial: true,
	},
	reloadDelay: 1000,
	notify: false,
	open: false,
	snippetOptions: {
		rule: {
			match: /<\/head>/i,
			fn: function (snippet, match) {
				return snippet + match;
			}
		}
	}
C
chomik 已提交
30
});