Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions frontend/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* global __dirname */

import { defineConfig } from "vite"
import { resolve } from "path"
import react from "@vitejs/plugin-react"
Expand Down Expand Up @@ -35,7 +33,7 @@ export default defineConfig(({ mode }) => {
name: "ssr-manifest",
apply: "build",
closeBundle() {
const manifestPath = resolve(__dirname, "../dist/frontend/.vite/manifest.json")
const manifestPath = resolve(import.meta.dirname, "../dist/frontend/.vite/manifest.json")
const manifest = JSON.parse(readFileSync(manifestPath, "utf8"))
const resolveEntry = (entryKey) => {
const entry = manifest[entryKey]
Expand Down Expand Up @@ -68,7 +66,10 @@ export default defineConfig(({ mode }) => {
// Vanilla bootstrap for the /a/<paste> markdown render page.
"pages/render/markdown.ts": resolveEntry("pages/render/markdown.ts"),
}
writeFileSync(resolve(__dirname, "../dist/frontend/.vite/ssr-manifest.json"), JSON.stringify(slim, null, 2))
writeFileSync(
resolve(import.meta.dirname, "../dist/frontend/.vite/ssr-manifest.json"),
JSON.stringify(slim, null, 2),
)
},
})

Expand All @@ -87,7 +88,7 @@ export default defineConfig(({ mode }) => {
},
load(id) {
if (id !== RESOLVED_ID) return
const langDir = resolve(__dirname, "../node_modules/highlight.js/lib/languages")
const langDir = resolve(import.meta.dirname, "../node_modules/highlight.js/lib/languages")
const aliases = {}
for (const f of readdirSync(langDir).sort()) {
if (!f.endsWith(".js") || f.endsWith(".js.js")) continue
Expand Down Expand Up @@ -128,9 +129,9 @@ export default defineConfig(({ mode }) => {
manifest: true,
rollupOptions: {
input: {
index: resolve(__dirname, "index.html"),
display: resolve(__dirname, "display.html"),
markdown: resolve(__dirname, "pages/render/markdown.ts"),
index: resolve(import.meta.dirname, "index.html"),
display: resolve(import.meta.dirname, "display.html"),
markdown: resolve(import.meta.dirname, "pages/render/markdown.ts"),
},
},
},
Expand Down
43 changes: 20 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,26 @@
"author": "SharzyL <me@sharzy.in>",
"license": "MIT",
"devDependencies": {
"@cloudflare/vitest-pool-workers": "^0.18.5",
"@cloudflare/vitest-plugin": "^1.0.0",
"@craftamap/esbuild-plugin-html": "^0.9.0",
"@eslint/js": "^10.0.1",
"@testing-library/dom": "^10.4.1",
"@testing-library/dom": "^10.4.2",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1",
"@types/node": "^25.9.3",
"@vitejs/plugin-react": "^6.0.3",
"@testing-library/react": "^16.3.3",
"@testing-library/user-event": "^14.6.7",
"@types/node": "^25.9.9",
"@vitejs/plugin-react": "^6.1.2",
"@vitest/coverage-istanbul": "4.1.10",
"eslint": "^10.7.0",
"eslint": "^10.12.0",
"jsdom": "^29.1.1",
"msw": "^2.15.0",
"prettier": "^3.9.5",
"toml": "^4.1.1",
"prettier": "^3.9.9",
"toml": "^4.3.0",
"typescript": "^6.0.3",
"typescript-eslint": "^8.64.0",
"vite": "^8.1.4",
"typescript-eslint": "^8.71.1",
"vite": "^8.3.4",
"vitest": "4.1.10",
"wrangler": "^4.111.0"
"wrangler": "^4.149.0"
},
"prettier": {
"singleQuote": false,
Expand All @@ -54,21 +54,18 @@
},
"dependencies": {
"@mjackson/multipart-parser": "^0.10.1",
"@tailwindcss/vite": "^4.3.2",
"@tailwindcss/vite": "^4.3.3",
"@types/bcrypt": "^6.0.0",
"@types/react": "^19.2.17",
"@types/react-dom": "^19.2.3",
"@types/react": "^19.3.0",
"@types/react-dom": "^19.3.0",
"bcrypt-ts": "^8.0.1",
"github-slugger": "^2.0.0",
"highlight.js": "^11.11.1",
"marked": "^18.0.6",
"highlight.js": "^11.12.0",
"marked": "^18.1.0",
"mime": "^4.1.0",
"react": "^19.2.7",
"react-dom": "^19.2.7",
"tailwindcss": "^4.3.2",
"react": "^19.3.0",
"react-dom": "^19.3.0",
"tailwindcss": "^4.3.3",
"xss": "^1.0.15"
},
"resolutions": {
"stringify-entities": "4.0.2"
}
}
Loading
Loading