File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import { iconsSpritesheet } from 'vite-plugin-icons-spritesheet'
1212
1313export default defineConfig ( ( config ) => {
1414 const mode = config . mode ?? process . env . NODE_ENV
15+ const isTest = mode === 'test' || Boolean ( process . env . VITEST )
1516 return {
1617 build : {
1718 target : 'es2022' ,
@@ -40,7 +41,7 @@ export default defineConfig((config) => {
4041 } ,
4142 resolve : {
4243 alias :
43- mode === 'test'
44+ isTest
4445 ? {
4546 '#app/utils/cache.server.ts' : path . resolve (
4647 'tests/mocks/cache-server.ts' ,
@@ -63,7 +64,7 @@ export default defineConfig((config) => {
6364 } ) ,
6465 // it would be really nice to have this enabled in tests, but we'll have to
6566 // wait until https://github.com/remix-run/remix/issues/9871 is fixed
66- mode === 'test' ? null : reactRouter ( ) ,
67+ isTest ? null : reactRouter ( ) ,
6768 mode === 'production' && process . env . SENTRY_AUTH_TOKEN
6869 ? sentryReactRouter ( sentryConfig , config )
6970 : null ,
You can’t perform that action at this time.
0 commit comments