Files

37 lines
911 B
TypeScript
Raw Permalink Normal View History

2023-08-24 11:37:07 +02:00
import copy from 'rollup-plugin-copy';
import replace from '@rollup/plugin-replace';
2023-06-04 16:59:38 +02:00
export default defineNitroConfig({
2025-07-31 11:45:59 +02:00
compatibilityDate: '2025-07-30',
preset: 'vercel_edge',
2023-06-04 16:59:38 +02:00
srcDir: '.vitepress',
routeRules: {
'/api/**': { cors: false },
},
2023-08-24 11:37:07 +02:00
rollupConfig: {
external: ['@resvg/resvg-wasm/index_bg.wasm', './index_bg.wasm?module'],
plugins: [
copy({
targets: [
{
src: './node_modules/@resvg/resvg-wasm/index_bg.wasm',
dest: './.vercel/output/functions/__nitro.func',
},
],
}),
replace({
include: ['./**/*.ts'],
'/* WASM_IMPORT */': 'import resvg_wasm from "./index_bg.wasm?module";',
delimiters: ['', ''],
preventAssignment: false,
}),
],
},
2023-06-04 16:59:38 +02:00
esbuild: {
options: {
2023-08-24 11:37:07 +02:00
jsxFactory: 'React.createElement',
jsxFragment: 'React.Fragment',
2023-06-04 16:59:38 +02:00
},
},
2023-08-24 11:37:07 +02:00
});