Versioning: - package.json is the single source of the version (0.2.0); the build injects it into the landing page and Storybook via src/version.ts - Add CHANGELOG.md and a release section in the README Deploy: - Refuse to deploy uncommitted work unless --allow-dirty is passed - Stamp each deploy with version.json and verify the live stamp - Serve HTML and JSON with Cache-Control: no-cache and cache only the content-hashed assets/ folders long-term - Return 404 for missing assets instead of index.html, which blanked the Storybook canvas for browsers holding a stale page - Always restore the hardened .htaccess, even when a step fails - Make the post-deploy PHP-off check real, build Storybook before checking for its index, and stop logging the session token
21 lines
633 B
TypeScript
21 lines
633 B
TypeScript
import { readFileSync } from 'node:fs'
|
|
import { fileURLToPath, URL } from 'node:url'
|
|
import react from '@vitejs/plugin-react'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import { defineConfig } from 'vite'
|
|
|
|
const pkg = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8')) as { version: string }
|
|
|
|
export default defineConfig({
|
|
// package.json is the single source of the version; see src/version.ts.
|
|
define: {
|
|
__TANSY_VERSION__: JSON.stringify(pkg.version),
|
|
},
|
|
plugins: [react(), tailwindcss()],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
},
|
|
},
|
|
})
|