Skip to content

Commit

Permalink
wip: refactor build
Browse files Browse the repository at this point in the history
  • Loading branch information
franklinkim committed May 14, 2024
1 parent 8d8b81f commit 337bc93
Show file tree
Hide file tree
Showing 9 changed files with 1,287 additions and 173 deletions.
56 changes: 0 additions & 56 deletions packages/sesamy/build.ts

This file was deleted.

10 changes: 5 additions & 5 deletions packages/sesamy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
"node": ">=20"
},
"scripts": {
"build": "pnpm clean && pnpm tsx build.ts",
"clean": "rimraf dist",
"build": "pnpm run build:client && pnpm run build:server",
"build:client": "tsup --config tsup.client.ts",
"build:server": "tsup --config tsup.server.ts",
"type-check": "tsc --noEmit"
},
"files": ["dist"],
Expand Down Expand Up @@ -55,10 +56,9 @@
"@types/react-dom": "18.2.18",
"react": "18.2.0",
"react-dom": "18.2.0",
"resolve-glob": "latest",
"typescript": "^5",
"tsx": "latest",
"rimraf": "latest",
"esbuild": "latest"
"tsup": "latest"
},
"peerDependencies": {
"react": "18.2.0",
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions packages/sesamy/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@repo/typescript-config/library-jsx.json",
"compilerOptions": {
"declaration": true,
"incremental": false,
"outDir": "./dist",
"lib": ["DOM", "ESNext"],
"paths": {
Expand Down
13 changes: 0 additions & 13 deletions packages/sesamy/tsub.config.ts

This file was deleted.

19 changes: 19 additions & 0 deletions packages/sesamy/tsup.client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {defineConfig} from "tsup";
// import { sync } from 'resolve-glob';



export default defineConfig({
dts: true,
clean: true,
target: "esnext",
format: "esm",
splitting: false,
// entry: ["src/components/GTMScript.tsx"],
entry: ["src/**/!(*.server|*.test|*.stories|*.spec).{ts,tsx}"],
outDir: "dist/client",
bundle: true,
minify: true,
sourcemap: true,
external: ["react", "react-dom"]
})
16 changes: 16 additions & 0 deletions packages/sesamy/tsup.server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { defineConfig, type Options} from "tsup";

export default defineConfig({
dts: true,
clean: true,
platform: "node",
format: "esm",
splitting: true,
// entry: ["src/components/GTMScript.tsx"],
entry: ["src/**/!(*.client|*.test|*.stories|*.spec).{ts,tsx}"],
outDir: "dist/server",
bundle: true,
minify: true,
sourcemap: true,
external: ["react", "react-dom"],
});
Loading

0 comments on commit 337bc93

Please sign in to comment.