diff --git a/examples/node/app/routes/_index.tsx b/examples/node/app/routes/_index.tsx index b4d5be2..c01ccd0 100644 --- a/examples/node/app/routes/_index.tsx +++ b/examples/node/app/routes/_index.tsx @@ -1,5 +1,6 @@ import type { LoaderFunctionArgs } from '@remix-run/node' import { useLoaderData } from '@remix-run/react' +import logoDark from '/logo-dark.png?inline' export const loader = (args: LoaderFunctionArgs) => { const extra = args.context.extra @@ -14,6 +15,12 @@ export default function Index() {

Remix and Hono

URL is {url}

Extra is {extra}

+
+ Remix +
) } diff --git a/examples/node/e2e.test.ts b/examples/node/e2e.test.ts index d0e8022..aa8ec3d 100644 --- a/examples/node/e2e.test.ts +++ b/examples/node/e2e.test.ts @@ -15,6 +15,11 @@ test('Should return 200 response - /', async ({ page }) => { const contentH3 = await page.textContent('h3') expect(contentH3).toBe('Extra is stuff') + + const images = await page.$$('img') + expect(images.length).toBe(1) + const imageResponse = await page.goto('/logo-dark.png') + expect(imageResponse?.status()).toBe(200) }) test('Should return 200 response - /api', async ({ page }) => { diff --git a/examples/node/public/logo-dark.png b/examples/node/public/logo-dark.png new file mode 100644 index 0000000..b24c7ae Binary files /dev/null and b/examples/node/public/logo-dark.png differ diff --git a/src/vite-plugin.ts b/src/vite-plugin.ts index b0d442e..9f907e4 100644 --- a/src/vite-plugin.ts +++ b/src/vite-plugin.ts @@ -31,6 +31,8 @@ export default (options: Options): Plugin => { '/assets/**', '/app/**', '/src/app/**', + // matches for vite's import assets suffixes + /\?(inline|url|no-inline|raw)/, ], injectClientScript: false, loadModule: async (server, entry) => {