Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
hoshinotsuyoshi committed Dec 27, 2024
1 parent 927e3fa commit 5a792bd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
17 changes: 16 additions & 1 deletion frontend/packages/cli/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { rmSync } from 'node:fs'
import fs from 'node:fs'
import react from '@vitejs/plugin-react'
import tsconfigPaths from 'vite-tsconfig-paths'
import { defineConfig } from 'vitest/config'
Expand Down Expand Up @@ -26,7 +27,21 @@ export default defineConfig({
],
},
},
plugins: [react(), tsconfigPaths(), setEnvPlugin()],
plugins: [
react(),
tsconfigPaths(),
setEnvPlugin(),

{
name: 'postprocess',
buildEnd() {
const filePath = 'dist-cli/bin/cli.js'
let content = fs.readFileSync(filePath, 'utf8')
content = content.replace(/import 'wasi';\s*/g, '')
fs.writeFileSync(filePath, content, 'utf8')
},
},
],
test: {
globals: true,
environment: 'node',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export async function loadPrism(): Promise<(source: string) => ParseResult> {

// Dynamic import for WASI to avoid warnings unless necessary
// biome-ignore lint/correctness/noNodejsModules: This import is server-side specific because loadPrism() is exclusively invoked in server environments.
const { WASI } = await import('wasi')
const { WASI } = await import('node:wasi')
const wasi = new WASI({ version: 'preview1' })

// Patch applied for compatibility
Expand Down

0 comments on commit 5a792bd

Please sign in to comment.