aboutsummaryrefslogtreecommitdiffhomepage
path: root/rollup.config.js
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2024-09-28 20:26:40 +0800
committerHsieh Chin Fan <pham@topo.tw>2024-09-28 20:26:40 +0800
commitf10d10f62f5ddd0146a8391f487c1753288a2a20 (patch)
tree19f5fdfc9830495646a04460f72048d4bc6fa06d /rollup.config.js
parent933eba7dc3bdc979fefadd47388b20b8360e1d6b (diff)
chore(build): update rollup for watching local mapclay
Diffstat (limited to 'rollup.config.js')
-rw-r--r--rollup.config.js13
1 files changed, 13 insertions, 0 deletions
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';
5import { join } from 'path'; 5import { join } from 'path';
6 6
7const production = !process.env.ROLLUP_WATCH; 7const production = !process.env.ROLLUP_WATCH;
8
8const general = { 9const general = {
9 output: [ 10 output: [
10 { 11 {
@@ -20,6 +21,18 @@ const general = {
20 context: "window", 21 context: "window",
21 plugins: [ 22 plugins: [
22 { 23 {
24 name: 'watch-mapclay',
25 buildStart() {
26 const mapclayPath = join(process.cwd(), 'mapclay', 'dist', 'mapclay.mjs');
27 console.log('Watching:', mapclayPath);
28 if (existsSync(mapclayPath)) {
29 this.addWatchFile(mapclayPath);
30 } else {
31 console.log('mapclay.mjs not found at:', mapclayPath);
32 }
33 }
34 },
35 {
23 name: 'leader-line', 36 name: 'leader-line',
24 transform(code, id) { 37 transform(code, id) {
25 if (id.includes('node_modules/leader-line/')) { 38 if (id.includes('node_modules/leader-line/')) {