mirror of
https://github.com/theoludwig/theoludwig.git
synced 2024-11-09 22:09:07 +01:00
34 lines
653 B
TypeScript
34 lines
653 B
TypeScript
|
import fs from 'node:fs'
|
||
|
|
||
|
import { defineConfig } from 'vite'
|
||
|
import { createHtmlPlugin } from 'vite-plugin-html'
|
||
|
import date from 'date-and-time'
|
||
|
|
||
|
const jsonResumeURL = new URL('./resume.json', import.meta.url)
|
||
|
const dataResumeStringJSON = await fs.promises.readFile(jsonResumeURL, {
|
||
|
encoding: 'utf-8'
|
||
|
})
|
||
|
const resume = JSON.parse(dataResumeStringJSON)
|
||
|
|
||
|
// https://vitejs.dev/config/
|
||
|
export default defineConfig({
|
||
|
build: {
|
||
|
assetsDir: './'
|
||
|
},
|
||
|
plugins: [
|
||
|
createHtmlPlugin({
|
||
|
inject: {
|
||
|
data: {
|
||
|
date,
|
||
|
locals: {
|
||
|
...resume
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
})
|
||
|
],
|
||
|
css: {
|
||
|
postcss: {}
|
||
|
}
|
||
|
})
|