mirror of
https://github.com/theoludwig/theoludwig.git
synced 2024-11-05 04:51:30 +01:00
37 lines
733 B
TypeScript
37 lines
733 B
TypeScript
import fs from 'node:fs'
|
|
|
|
import { defineConfig } from 'vite'
|
|
import { parse as JSONCParser } from 'jsonc-parser'
|
|
import { createHtmlPlugin } from 'vite-plugin-html'
|
|
import date from 'date-and-time'
|
|
|
|
const jsonResumeURL = new URL('../resume.jsonc', import.meta.url)
|
|
const dataResumeStringJSON = await fs.promises.readFile(jsonResumeURL, {
|
|
encoding: 'utf-8'
|
|
})
|
|
const resume = JSONCParser(dataResumeStringJSON)
|
|
|
|
/**
|
|
* Documentation: <https://vitejs.dev/config/>
|
|
*/
|
|
export default defineConfig({
|
|
build: {
|
|
assetsDir: './'
|
|
},
|
|
plugins: [
|
|
createHtmlPlugin({
|
|
inject: {
|
|
data: {
|
|
date,
|
|
locals: {
|
|
...resume
|
|
}
|
|
}
|
|
}
|
|
})
|
|
],
|
|
css: {
|
|
postcss: {}
|
|
}
|
|
})
|