1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2024-09-17 05:25:54 +02:00
.profile/jsonresume-theme-custom/vite.config.ts
2022-11-29 10:29:02 +01:00

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: {}
}
})