Skip to content

Commit

Permalink
Try this
Browse files Browse the repository at this point in the history
  • Loading branch information
ericfennis committed Aug 16, 2024
1 parent 0252b23 commit b49a08c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion docs/.vitepress/api/gh-icon/dpi/loadWasm.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from 'fs';
import module from 'node:module';
/* WASM_IMPORT */
import resvg_wasm from '@resvg/resvg-wasm/index_bg.wasm';

let wasm;

Expand Down
42 changes: 21 additions & 21 deletions docs/nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
import copy from 'rollup-plugin-copy';
import replace from '@rollup/plugin-replace';
// import copy from 'rollup-plugin-copy';
// import replace from '@rollup/plugin-replace';

export default defineNitroConfig({
preset: 'vercel_edge',
srcDir: '.vitepress',
routeRules: {
'/api/**': { cors: false },
},
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,
}),
],
},
// 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,
// }),
// ],
// },
esbuild: {
options: {
jsxFactory: 'React.createElement',
Expand Down

0 comments on commit b49a08c

Please sign in to comment.