diff --git a/bun.lockb b/bun.lockb index 902c2f5..7283bbe 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index e87b00d..df6dc98 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { - "build": "rm -rf ./dist && rollup -c", + "build": "rollup -c", + "dev": "rollup -c -w", "lint": "eslint" }, "type": "module", @@ -36,7 +37,8 @@ "d3-path": "^3.1.0", "d3-scale": "^4.0.2", "d3-selection": "^3.0.0", - "d3-shape": "^3.2.0" + "d3-shape": "^3.2.0", + "rollup-plugin-delete": "^2.0.0" }, "devDependencies": { "@anymud/bun-plugin-dts": "^1.0.2", diff --git a/rollup.config.js b/rollup.config.js index 14e7d72..95d4c3d 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,6 +1,9 @@ import { nodeResolve } from "@rollup/plugin-node-resolve"; import terser from "@rollup/plugin-terser"; import typescript from "@rollup/plugin-typescript"; +import del from "rollup-plugin-delete"; + +const outDir = "dist"; /** * @type {import('rollup').RollupOptions} @@ -8,10 +11,12 @@ import typescript from "@rollup/plugin-typescript"; const config = { input: "src/index.ts", output: { - dir: "dist", + dir: outDir, format: "es", }, + cache: false, plugins: [ + del({ targets: `${outDir}/*` }), nodeResolve(), terser({ format: { @@ -19,7 +24,7 @@ const config = { }, }), typescript({ - outDir: "dist", + outDir, }), ], };