Skip to content

Commit

Permalink
fix(plugin-react-refresh): skip during ssr
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 18, 2021
1 parent 07f211a commit d1383ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/playground/ssr/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import vuePlugin from '@vitejs/plugin-vue'
import reactRefresh from '@vitejs/plugin-react-refresh'

export default {
plugins: [vuePlugin()]
plugins: [vuePlugin(), reactRefresh()]
}
4 changes: 2 additions & 2 deletions packages/plugin-react-refresh/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ module.exports = function reactRefreshPlugin() {
}
},

transform(code, id) {
if (shouldSkip) {
transform(code, id, ssr) {
if (shouldSkip || ssr) {
return
}

Expand Down

0 comments on commit d1383ed

Please sign in to comment.