Skip to content

Commit

Permalink
[remix] Add mjs and mts extensions to vite detection (#11307)
Browse files Browse the repository at this point in the history
My project was being incorrectly detected as not vite, thus it was failing in runtime. My vite config is `vite.config.mts` so this PR fixes detection logic to include `mjs` and `mts` extensions.

The fix can be generalized if needed.
  • Loading branch information
frontsideair committed Mar 22, 2024
1 parent 7a28972 commit 988f7b7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/slimy-nails-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vercel/remix-builder": patch
---

Add `mjs` and `mts` extensions to vite detection
7 changes: 6 additions & 1 deletion packages/remix/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,12 @@ export function logNftWarnings(warnings: Set<Error>, required?: string) {
}

export function isVite(dir: string): boolean {
const viteConfig = findConfig(dir, 'vite.config', ['.js', '.ts']);
const viteConfig = findConfig(dir, 'vite.config', [
'.js',
'.ts',
'.mjs',
'.mts',
]);
if (!viteConfig) return false;

const remixConfig = findConfig(dir, 'remix.config');
Expand Down

0 comments on commit 988f7b7

Please sign in to comment.