1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2024-11-08 22:31:30 +01:00
.profile/jsonresume-theme-custom/vite.config.ts
2022-07-28 23:01:19 +02:00

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