Skip to content

Commit

Permalink
chore: Use rollup-plugin-delete instead of rm
Browse files Browse the repository at this point in the history
  • Loading branch information
bprusinowski committed Apr 21, 2024
1 parent 764430f commit d1d61a4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Binary file modified bun.lockb
Binary file not shown.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "rm -rf ./dist && rollup -c",
"build": "rollup -c",
"lint": "eslint"
},
"type": "module",
Expand All @@ -36,7 +36,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",
Expand Down
9 changes: 7 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
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}
*/
const config = {
input: "src/index.ts",
output: {
dir: "dist",
dir: outDir,
format: "es",
},
cache: false,
plugins: [
del({ targets: `${outDir}/*` }),
nodeResolve(),
terser({
format: {
comments: false,
},
}),
typescript({
outDir: "dist",
outDir,
}),
],
};
Expand Down

0 comments on commit d1d61a4

Please sign in to comment.