diff --git a/packages/dev-server/src/dev-server.ts b/packages/dev-server/src/dev-server.ts index 2de1bc6..4fca3b1 100644 --- a/packages/dev-server/src/dev-server.ts +++ b/packages/dev-server/src/dev-server.ts @@ -23,7 +23,7 @@ export type DevServerOptions = { export const defaultOptions: Required> = { entry: './src/index.ts', injectClientScript: true, - exclude: ['.*.ts', '.*.tsx', '/@.+', '/node_modules/.*'], + exclude: ['.*\\.ts', '.*\\.tsx', '/@.+', '\\/node_modules\\/.*'], } interface ExecutionContext { diff --git a/packages/dev-server/test/e2e.test.ts b/packages/dev-server/test/e2e.test.ts index e921f8b..cf761f8 100644 --- a/packages/dev-server/test/e2e.test.ts +++ b/packages/dev-server/test/e2e.test.ts @@ -41,6 +41,9 @@ test('Should exclude the file specified in the config file', async ({ page }) => let response = await page.goto('/file.ts') expect(response?.status()).toBe(404) + response = await page.goto('/ends-in-ts') + expect(response?.status()).toBe(200) + response = await page.goto('/app/foo') expect(response?.status()).toBe(404) }) diff --git a/packages/dev-server/test/mock/worker.ts b/packages/dev-server/test/mock/worker.ts index 3867c0a..ff2fb3f 100644 --- a/packages/dev-server/test/mock/worker.ts +++ b/packages/dev-server/test/mock/worker.ts @@ -19,5 +19,8 @@ app.get('/file.ts', (c) => { app.get('/app/foo', (c) => { return c.html('

exclude me!

') }) +app.get('/ends-in-ts', (c) => { + return c.text('this should not be excluded') +}) export default app