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

34 lines
654 B
TypeScript
Raw Normal View History

import fs from 'node:fs'
import { defineConfig } from 'vite'
import { createHtmlPlugin } from 'vite-plugin-html'
import date from 'date-and-time'
2022-07-28 23:01:19 +02:00
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: {}
}
})