Skip to content

Commit

Permalink
Clear dist directory before building
Browse files Browse the repository at this point in the history
  • Loading branch information
Exidex committed Jul 22, 2024
1 parent 27b82be commit 5b56658
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
20 changes: 20 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"chalk": "^5.3.0",
"commander": "^12.1.0",
"rollup": "^4.19.0",
"rollup-plugin-cleandir": "^2.0.0",
"rollup-plugin-typescript2": "^0.36.0",
"simple-git": "^3.25.0",
"tail": "^2.2.6",
Expand Down
2 changes: 2 additions & 0 deletions rollup.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import typescript from "rollup-plugin-typescript2";
import json from '@rollup/plugin-json';
import { defineConfig } from "rollup";
import { cleandir } from "rollup-plugin-cleandir";

export default defineConfig({
input: [
Expand All @@ -14,6 +15,7 @@ export default defineConfig({
}
],
plugins: [
cleandir(),
typescript({
tsconfig: './tsconfig.json',
}),
Expand Down
3 changes: 2 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import nodeResolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import typescript from "rollup-plugin-typescript2";
import { cpSync, readFileSync, writeFileSync } from "node:fs";
import { fromError } from 'zod-validation-error';
import { cleandir } from "rollup-plugin-cleandir";

// needs to be valid and properly cased js identifier
const preferenceName = z.string()
Expand Down Expand Up @@ -279,6 +279,7 @@ export function rollupInputOptions(manifest: Manifest, additionalPlugins: Plugin
external: ["react", "react/jsx-runtime", /^@project-gauntlet\/api/],
plugins: [
...additionalPlugins,
cleandir(),
nodeResolve(),
commonjs(),
typescript({
Expand Down

0 comments on commit 5b56658

Please sign in to comment.