From f4a24611146ef7d1c931a2614c739787315ffdbe Mon Sep 17 00:00:00 2001 From: Jan Kuri Date: Wed, 15 Feb 2017 18:38:15 +0100 Subject: [PATCH] bla --- .gitignore | 2 +- scripts/plugins/rollup-plugin-livereload.js | 36 +++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 scripts/plugins/rollup-plugin-livereload.js diff --git a/.gitignore b/.gitignore index 0234575a5..4cc698b06 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ **/*.d.ts !scripts/index.js -!scripts/plugins +!scripts/plugins/**/* .DS_Store/ diff --git a/scripts/plugins/rollup-plugin-livereload.js b/scripts/plugins/rollup-plugin-livereload.js new file mode 100644 index 000000000..4597001fe --- /dev/null +++ b/scripts/plugins/rollup-plugin-livereload.js @@ -0,0 +1,36 @@ +'use strict'; + +var livereload = require('livereload'); +var path = require('path'); + +var opts = { consoleLogMsg: true }; + +function livereload$1 (options) { + if ( options === void 0 ) options = { watch: '' }; + + if (typeof options === 'string') { + options = Object.assign(opts, { watch: options }); + } + + var port = options.port || 35729; + var server = livereload.createServer(options); + server.watch(path.resolve(process.cwd(), options.watch)); + + opts = Object.assign(opts, options); + + return { + name: 'livereload', + banner: ("document.write('