feat: add footer with version and donate link
This commit is contained in:
parent
33762e53b5
commit
21778a43f1
2 changed files with 56 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ import { installGlobals } from '@remix-run/node'
|
|||
import { defineConfig } from 'vite'
|
||||
import babel from 'vite-plugin-babel'
|
||||
import tsconfigPaths from 'vite-tsconfig-paths'
|
||||
import { execSync } from 'node:child_process'
|
||||
|
||||
installGlobals()
|
||||
|
||||
|
|
@ -11,6 +12,12 @@ if (prefix.endsWith('/')) {
|
|||
throw new Error('Prefix must not end with a slash')
|
||||
}
|
||||
|
||||
// Load the version via git tags
|
||||
const version = execSync('git describe --tags --always').toString().trim()
|
||||
if (!version) {
|
||||
throw new Error('Unable to execute git describe')
|
||||
}
|
||||
|
||||
export default defineConfig(({ isSsrBuild }) => {
|
||||
// If we have the Headplane entry we build it as a single
|
||||
// server.mjs file that is built for production server bundle
|
||||
|
|
@ -45,6 +52,9 @@ export default defineConfig(({ isSsrBuild }) => {
|
|||
return ({
|
||||
base: `${prefix}/`,
|
||||
build: isSsrBuild ? { target: 'ES2022' } : {},
|
||||
define: {
|
||||
__VERSION__: JSON.stringify(version),
|
||||
},
|
||||
plugins: [
|
||||
remix({
|
||||
basename: `${prefix}/`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue