Skip to content

Commit

Permalink
fix: Support .cjs & .mjs extensions in Vite plugin (#549)
Browse files Browse the repository at this point in the history
* fix: Support `.cjs` & `.mjs` extensions in Vite plugin

* docs: Add changeset
  • Loading branch information
rschristian authored Jun 26, 2024
1 parent 75c14fd commit b729d4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/beige-trainers-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@prefresh/vite': patch
---

Support `.cjs` and `.mjs` file extensions in Vite plugin
2 changes: 1 addition & 1 deletion packages/vite/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = function prefreshPlugin(options = {}) {
: options && options.ssr === true;
if (
shouldSkip ||
!/\.(t|j)sx?$/.test(id) ||
!/\.(c|m)?(t|j)sx?$/.test(id) ||
id.includes('node_modules') ||
id.includes('?worker') ||
!filter(id) ||
Expand Down

0 comments on commit b729d4d

Please sign in to comment.