1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2024-11-05 04:51:30 +01:00
.profile/jsonresume-theme-custom/vite.config.ts

37 lines
733 B
TypeScript
Raw Permalink Normal View History

import fs from 'node:fs'
import { defineConfig } from 'vite'
2022-11-29 10:29:02 +01:00
import { parse as JSONCParser } from 'jsonc-parser'
import { createHtmlPlugin } from 'vite-plugin-html'
import date from 'date-and-time'
2022-11-29 10:29:02 +01:00
const jsonResumeURL = new URL('../resume.jsonc', import.meta.url)
const dataResumeStringJSON = await fs.promises.readFile(jsonResumeURL, {
encoding: 'utf-8'
})
2022-11-29 10:29:02 +01:00
const resume = JSONCParser(dataResumeStringJSON)
2022-11-29 10:29:02 +01:00
/**
* Documentation: <https://vitejs.dev/config/>
*/
export default defineConfig({
build: {
assetsDir: './'
},
plugins: [
createHtmlPlugin({
inject: {
data: {
date,
locals: {
...resume
}
}
}
})
],
css: {
postcss: {}
}
})