2022-07-28 21:20:41 +02:00
|
|
|
import { fileURLToPath } from 'node:url'
|
2022-07-01 23:12:47 +02:00
|
|
|
import fs from 'node:fs'
|
2022-03-14 09:09:46 +01:00
|
|
|
|
2022-07-28 21:20:41 +02:00
|
|
|
import { build } from 'vite'
|
2022-03-14 09:09:46 +01:00
|
|
|
|
2022-07-28 21:20:41 +02:00
|
|
|
const jsonResumeThemeCustom = new URL('../', import.meta.url)
|
|
|
|
const jsonResumeThemeCustomDist = new URL('./dist', jsonResumeThemeCustom)
|
|
|
|
const publicResumeOutputURL = new URL(
|
|
|
|
'../../public/curriculum-vitae',
|
2022-03-14 09:09:46 +01:00
|
|
|
import.meta.url
|
|
|
|
)
|
|
|
|
|
2022-07-28 21:20:41 +02:00
|
|
|
await build({
|
2022-08-23 13:31:17 +02:00
|
|
|
root: fileURLToPath(jsonResumeThemeCustom),
|
|
|
|
base: '/curriculum-vitae/'
|
2022-03-14 09:09:46 +01:00
|
|
|
})
|
2022-07-23 23:00:58 +02:00
|
|
|
|
2022-07-28 21:20:41 +02:00
|
|
|
await fs.promises.cp(jsonResumeThemeCustomDist, publicResumeOutputURL, {
|
|
|
|
recursive: true
|
|
|
|
})
|