Skip to content

Commit

Permalink
chore: use tsup to bundle plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
MaikoTan committed Dec 24, 2023
1 parent bae769e commit 5ee0c77
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@
"url": "git+https://github.com/AwesomeHamster/koishi-plugin-hitokoto.git"
},
"scripts": {
"build": "tsc",
"dev": "constructeur build --minify false && tsc --emitDeclarationOnly",
"build": "yarn build:tsup --minify",
"dev": "yarn build:tsup",
"build:tsup": "tsup",
"clean": "rimraf dist/*",
"test": "mocha -r esbuild-register -r yml-register --extension .spec.ts ./__tests__",
"lint": "eslint src/**/*.ts && yarn prettier --check",
Expand Down Expand Up @@ -82,6 +83,7 @@
"@typescript-eslint/parser": "^6.13.1",
"chai": "^4.3.10",
"esbuild": "^0.19.8",
"esbuild-plugin-yaml": "^0.0.1",
"esbuild-register": "^3.5.0",
"eslint": "^8.54.0",
"eslint-import-resolver-typescript": "^3.6.1",
Expand All @@ -90,6 +92,7 @@
"mocha": "^10.2.0",
"prettier": "^3.1.0",
"rimraf": "^5.0.5",
"tsup": "^8.0.1",
"typescript": "^5.3.2",
"yml-register": "^1.1.0"
}
Expand Down
2 changes: 0 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"extends": "@hamster-bot/tsconfig",
"compilerOptions": {
"target": "es2022",
"composite": true,
"incremental": true,
"rootDir": "src",
"module": "CommonJS",
"outDir": "lib",
Expand Down
13 changes: 13 additions & 0 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import yaml from 'esbuild-plugin-yaml'
import { defineConfig } from 'tsup'

export default defineConfig({
entry: ['src/index.ts'],
dts: true,
format: ['cjs'],
clean: true,
outDir: 'lib',
esbuildPlugins: [yaml.yamlPlugin()],
esbuildOptions(options, context) {
},
})

0 comments on commit 5ee0c77

Please sign in to comment.