Removes every comment introduced on this branch: website/ in full, pages.yml in full, and only the blocks added to ci.yml and release.yml — their pre-existing comments are untouched. Two directives survive because they are load-bearing rather than prose: the triple-slash vite/client reference, and nothing else. Two comments were carrying behaviour that the code did not state, so the code now states it. useCopy's rejection handler clears the copied flag instead of sitting empty, and writeTheme returns whether the write actually landed instead of swallowing the failure in a bare catch. isExternal drops its regex for two startsWith calls, which reads the same and no longer hides a `//` inside a literal.
34 lines
843 B
TypeScript
34 lines
843 B
TypeScript
import { readFileSync } from 'node:fs'
|
|
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import { defineConfig } from 'vite'
|
|
|
|
const cargoToml = readFileSync(
|
|
fileURLToPath(new URL('../Cargo.toml', import.meta.url)),
|
|
'utf8',
|
|
)
|
|
const versionMatch = /^\s*version\s*=\s*"([^"]+)"/m.exec(cargoToml)
|
|
if (versionMatch?.[1] === undefined)
|
|
throw new Error('could not read version from ../Cargo.toml')
|
|
const VERSION = `v${versionMatch[1]}`
|
|
|
|
const BASE = '/soulseek-rs/'
|
|
|
|
export default defineConfig({
|
|
base: BASE,
|
|
define: {
|
|
__APP_VERSION__: JSON.stringify(VERSION),
|
|
},
|
|
plugins: [react(), tailwindcss()],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
},
|
|
},
|
|
build: {
|
|
chunkSizeWarningLimit: 600,
|
|
},
|
|
})
|