Skip to content

Commit

Permalink
feat: bundling project with tsup
Browse files Browse the repository at this point in the history
  • Loading branch information
barbmarcio committed Jul 16, 2024
1 parent 244ea46 commit 735ff57
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 10 deletions.
Binary file modified bun.lockb
Binary file not shown.
14 changes: 6 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,19 @@
},
"files": ["dist/*"],
"scripts": {
"build": "bun build src/index.ts --outdir=dist",
"build": "rm -rf dist && bun run tsup",
"test": "bun test",
"format": "biome check",
"format:fix": "biome check --write",
"prepare": "lefthook install"
},
"devDependencies": {
"@biomejs/biome": "1.8.3",
"lefthook": "^1.6.18",
"@supabase/doctest-js": "^0.1.0",
"@types/bun": "^1.1.6",
"msw": "^2.3.1"
},
"peerDependencies": {
"typescript": "^5.0.0"
},
"dependencies": {}
"lefthook": "^1.6.18",
"msw": "^2.3.1",
"tsup": "^8.1.0",
"typescript": "^5.5.3"
}
}
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { reportEvent } from "./functions/report-event";
export { createAuction } from "./functions/create-auction";
export * from "./interfaces/events.interface";
export * from "./interfaces/auctions.interface";
6 changes: 4 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
"moduleDetection": "force",
"allowImportingTsExtensions": true,
"noEmit": true,
"composite": true,
"strict": true,
"downlevelIteration": true,
"skipLibCheck": true,
"jsx": "react-jsx",
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"removeComments": true,
"allowJs": true
}
},
"include": ["src/*.ts", "src/**/*.ts"],
"exclude": ["node_modules"]
}
12 changes: 12 additions & 0 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineConfig } from "tsup";

export default defineConfig({
entry: ["src/index.ts"],
format: ["cjs", "esm"],
dts: true,
clean: true,
minify: true,
esbuildOptions(options) {
options.keepNames = true;
},
});

0 comments on commit 735ff57

Please sign in to comment.