From f10d10f62f5ddd0146a8391f487c1753288a2a20 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Sat, 28 Sep 2024 20:26:40 +0800 Subject: chore(build): update rollup for watching local mapclay --- rollup.config.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/rollup.config.js b/rollup.config.js index d04eb4e..1f46f2a 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -5,6 +5,7 @@ import { existsSync } from 'fs'; import { join } from 'path'; const production = !process.env.ROLLUP_WATCH; + const general = { output: [ { @@ -19,6 +20,18 @@ const general = { }, context: "window", plugins: [ + { + name: 'watch-mapclay', + buildStart() { + const mapclayPath = join(process.cwd(), 'mapclay', 'dist', 'mapclay.mjs'); + console.log('Watching:', mapclayPath); + if (existsSync(mapclayPath)) { + this.addWatchFile(mapclayPath); + } else { + console.log('mapclay.mjs not found at:', mapclayPath); + } + } + }, { name: 'leader-line', transform(code, id) { -- cgit v1.2.3-70-g09d2