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 9532191 commit 868f78c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,5 @@ dist
# TernJS port file
.tern-port

lib
package-lock.json
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
],
"homepage": "https://github.com/AwesomeHamster/koishi-plugin-ffxiv-eorzea",
"license": "MIT",
"main": "dist/index.bundle.js",
"main": "lib/index.js",
"directories": {
"src": "src",
"test": "__tests__"
},
"files": [
"dist",
"lib",
"README.md",
"LICENSE"
],
Expand All @@ -44,12 +44,13 @@
"url": "git+https://github.com/AwesomeHamster/koishi-plugin-ffxiv-eorzea.git"
},
"scripts": {
"build": "constructeur build && tsc --emitDeclarationOnly",
"dev": "constructeur build --minify false && tsc --emitDeclarationOnly",
"build": "yarn build:tsup --minify",
"dev": "yarn build:tsup",
"build:tsup": "tsup",
"test": "mocha -r ts-node/register -r yml-register --extension .spec.ts ./__tests__",
"lint": "eslint src/**/*.ts && yarn prettier --check",
"format": "yarn prettier --write",
"prettier": "prettier '**/*.{js,ts,json,yml,yaml,md}' '!dist/**/*'"
"prettier": "prettier '**/*.{js,ts,json,yml,yaml,md}' '!lib/**/*'"
},
"bugs": {
"url": "https://github.com/AwesomeHamster/koishi-plugin-ffxiv-eorzea/issues"
Expand Down Expand Up @@ -77,7 +78,6 @@
"packageManager": "[email protected]",
"prettier": "@hamster-bot/prettier-config",
"devDependencies": {
"@hamster-bot/constructeur": "*",
"@hamster-bot/eslint-config": "*",
"@hamster-bot/prettier-config": "*",
"@koishijs/plugin-mock": "^2.0.2",
Expand All @@ -90,6 +90,7 @@
"mocha": "^9.2.0",
"prettier": "^2.7.1",
"ts-node": "^10.8.1",
"tsup": "^8.0.1",
"typescript": "^4.7.3",
"yml-register": "^1.1.0"
}
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 868f78c

Please sign in to comment.