mirror of
https://github.com/modrinth/code.git
synced 2026-08-25 00:55:25 +00:00
fix(api-client): add explicit extensions to relative imports (#6609)
* Add explicit extensions to relative imports * Add linting rule * Fix outdated pnpm lock * fix: use esbuild --------- Co-authored-by: Prospector <6166773+Prospector@users.noreply.github.com> Co-authored-by: Calum H. (IMB11) <contact@cal.engineer> Co-authored-by: Calum H. <calum@modrinth.com>
This commit is contained in:
co-authored by
Prospector
Calum H.
Calum H.
parent
cafe58dc3c
commit
8cca911775
@@ -0,0 +1,24 @@
|
||||
import { build } from 'esbuild'
|
||||
import dts from 'unplugin-dts/esbuild'
|
||||
|
||||
await build({
|
||||
entryPoints: ['src/index.ts'],
|
||||
outdir: 'dist',
|
||||
entryNames: '[name]',
|
||||
bundle: true,
|
||||
format: 'esm',
|
||||
platform: 'neutral',
|
||||
target: 'es2020',
|
||||
minify: true,
|
||||
sourcemap: true,
|
||||
legalComments: 'none',
|
||||
external: ['ofetch', 'mitt', '@tauri-apps/plugin-http'],
|
||||
plugins: [
|
||||
dts({
|
||||
bundleTypes: true,
|
||||
outDirs: 'dist',
|
||||
processor: 'ts',
|
||||
tsconfigPath: './tsconfig.build.json',
|
||||
}),
|
||||
],
|
||||
})
|
||||
@@ -34,7 +34,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "node --eval \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
|
||||
"build": "pnpm run clean && esbuild src/index.ts --bundle --format=esm --platform=neutral --target=es2020 --minify --legal-comments=none --outfile=dist/index.js --external:ofetch --external:mitt --external:@tauri-apps/plugin-http && tsc -p tsconfig.build.json",
|
||||
"build": "pnpm run clean && node esbuild.config.mjs",
|
||||
"prepare": "pnpm run build",
|
||||
"lint": "eslint . && prettier --check .",
|
||||
"fix": "eslint . --fix && prettier --write ."
|
||||
@@ -44,10 +44,12 @@
|
||||
"ofetch": "^1.4.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@microsoft/api-extractor": "^7.58.9",
|
||||
"@modrinth/tooling-config": "workspace:*",
|
||||
"@tauri-apps/plugin-http": "^2.0.0",
|
||||
"esbuild": "0.27.2",
|
||||
"typescript": "^5.9.3"
|
||||
"typescript": "^5.9.3",
|
||||
"unplugin-dts": "^1.0.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@tauri-apps/plugin-http": "^2.0.0"
|
||||
|
||||
Reference in New Issue
Block a user