From 87970358fdf6fc611258ea2fc4683644153b8c6c Mon Sep 17 00:00:00 2001 From: Guy Baron Date: Mon, 28 Nov 2022 13:08:32 -0500 Subject: [PATCH] Revert "use rollup watch when in watch mode" This reverts commit de386a6a84664391f178bfe5b4a20a504437dde0. --- lib/index.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/index.js b/lib/index.js index 42ddd60..ec8e396 100644 --- a/lib/index.js +++ b/lib/index.js @@ -67,20 +67,12 @@ function createPreprocessor(preconfig, config, emitter, logger) { options.output.dir = path.dirname(originalPath) } - let bundle; - options.cache = false; + let bundle = await rollup.rollup(options) + cache.set(originalPath, bundle.cache) if (watcher) { - const watch = await rollup.watch(options); - bundle = await new Promise(res => watch.on('event', ( { result, code }) => { - if (code === 'BUNDLE_END') return res(result); - })); - let [entry, ...dependencies] = bundle.watchFiles watcher.add(entry, dependencies) - } else { - bundle = await rollup.rollup(options) - cache.set(originalPath, bundle.cache) } log.info('Generating bundle for ./%s', location)