Skip to content

Commit

Permalink
refactor: build process to use tsup instead of esbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
tooooo1 committed Sep 25, 2023
1 parent e82ef57 commit ba8abef
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 44 deletions.
25 changes: 0 additions & 25 deletions packages/image/esbuild.config.js

This file was deleted.

21 changes: 11 additions & 10 deletions packages/image/package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
{
"name": "@fepack/image",
"version": "0.2.1",
"description": "Image preloader for fepack",
"description": "easy image control",
"keywords": [
"fepack",
"image",
"preloader"
"image"
],
"repository": {
"type": "git",
"url": "https://github.com/fepack/image.git",
"directory": "packages/image"
},
"license": "MIT",
"author": "tooooo1",
"author": {
"name": "Chung-il Jung",
"email": "[email protected]"
},
"sideEffects": false,
"type": "module",
"exports": {
Expand All @@ -36,12 +38,11 @@
"src"
],
"scripts": {
"build": "pnpm clean && pnpm build:tsc && pnpm build:js && pnpm copy:cts",
"build:js": "node ./esbuild.config.js",
"build:tsc": "tsc --emitDeclarationOnly",
"clean": "rm -rf dist",
"copy:cts": "cp dist/index.d.ts dist/index.d.cts",
"build": "tsup",
"build:watch": "tsup --watch",
"clean": "rimraf ./dist && rimraf ./coverage",
"lint": "eslint \"**/*.ts*\"",
"lint:pack": "packlint sort -R",
"lint:pub": "publint --strict",
"prepack": "pnpm build",
"test": "vitest run --coverage",
Expand All @@ -54,9 +55,9 @@
"@types/node": "^20.6.2",
"@vitest/browser": "^0.34.4",
"@vitest/coverage-istanbul": "^0.34.4",
"esbuild": "^0.18.11",
"jsdom": "^22.1.0",
"playwright": "^1.38.0",
"tsup": "^7.1.0",
"vitest": "^0.34.3"
},
"publishConfig": {
Expand Down
3 changes: 1 addition & 2 deletions packages/image/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"extends": "@fepack/tsconfig/base.json",
"exclude": ["node_modules"],
"compilerOptions": {
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"declarationDir": "dist"
"lib": ["ES2020", "DOM", "DOM.Iterable"]
},
"include": ["src/index.ts"]
}
10 changes: 10 additions & 0 deletions packages/image/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from "tsup";

export default defineConfig({
banner: { js: '"use client"' },
format: ["cjs", "esm"],
entry: ["src/*.{ts,tsx}", "!**/*.{spec,test}.*"],
sourcemap: true,
dts: true,
splitting: false,
});
49 changes: 42 additions & 7 deletions pnpm-lock.yaml

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

0 comments on commit ba8abef

Please sign in to comment.