scruffy
scruffy
Explore posts from servers
HHono
Created by scruffy on 6/28/2024 in #help
Using Vitest with Hono JSX // Error: Expression expected
This is now solved... the answer is to configure esbuild in the vitest.config.js:
// vitest.config.js
import { defineConfig } from 'vitest/config'

export default defineConfig({
esbuild: {
exclude: [],
include: /.*\.jsx?$/,
jsx: 'automatic',
jsxImportSource: 'hono/jsx',
loader: 'jsx'
}
})
// vitest.config.js
import { defineConfig } from 'vitest/config'

export default defineConfig({
esbuild: {
exclude: [],
include: /.*\.jsx?$/,
jsx: 'automatic',
jsxImportSource: 'hono/jsx',
loader: 'jsx'
}
})
3 replies
HHono
Created by scruffy on 6/28/2024 in #help
Using Vitest with Hono JSX // Error: Expression expected
I created a repo at https://github.com/scruffymongrel/hono-jsx-vitest-repro in case it helps make this easier to answer.
3 replies