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 538d26b commit 41289bf
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 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
16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
},
"homepage": "https://github.com/AwesomeHamster/koishi-plugin-ffxiv-macrodict",
"license": "MIT",
"main": "dist/index.bundle.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"directories": {
"src": "src",
"test": "__tests__"
},
"files": [
"dist",
"lib",
"view",
"LICENCE",
"README.md"
Expand All @@ -34,12 +34,13 @@
"url": "git+https://github.com/AwesomeHamster/koishi-plugin-ffxiv-macrodict.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/**/*'",
"doc": "md-magic --path 'README*.md'"
},
"bugs": {
Expand Down Expand Up @@ -68,9 +69,9 @@
},
"prettier": "@hamster-bot/prettier-config",
"devDependencies": {
"@hamster-bot/constructeur": "*",
"@hamster-bot/eslint-config": "*",
"@hamster-bot/prettier-config": "*",
"@hamster-bot/tsconfig": "^0.0.2",
"@koishijs/plugin-database-memory": "^1.4.1",
"@koishijs/plugin-mock": "^2.0.0",
"@types/chai": "^4.3.1",
Expand All @@ -85,7 +86,8 @@
"markdown-magic": "^2.6.1",
"mocha": "^9.1.3",
"prettier": "^2.7.1",
"ts-node": "^10.4.0",
"ts-node": "^10.8.1",
"tsup": "^8.0.1",
"typescript": "^4.9.4",
"yml-register": "^1.1.0"
},
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@hamster-bot/constructeur/tsconfig.base.json",
"extends": "@hamster-bot/tsconfig",
"compilerOptions": {
"outDir": "dist",
"types": ["mocha"]
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 41289bf

Please sign in to comment.