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({
|
2024-01-16 16:22:09 +01:00
|
|
|
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
|
|
|
});
|