Skip to content

Commit

Permalink
fix: workaround Vite bug that wrongfully pre-optimizes telefunc module
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Nov 3, 2022
1 parent 1b2be97 commit 7ead64b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion telefunc/node/vite/plugins/devConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,17 @@ function devConfig(): Plugin[] {
apply: apply('dev'),
config: () => ({
optimizeDeps: {
include: ['telefunc/client', '@brillout/json-s/parse', '@brillout/json-s/stringify']
include: [
'telefunc/client',
'@brillout/json-s/parse',
'@brillout/json-s/stringify',
// Vite bug workaround. I don't know why, but Vite somehow thinks it needs to pre-optimize `telefunc` module:
// ```
// 11:12:30 AM [vite] ✨ new dependencies optimized: telefunc
// 11:12:30 AM [vite] ✨ optimized dependencies changed. reloading
// ```
'telefunc'
]
}
}),
async configResolved(config) {
Expand Down

0 comments on commit 7ead64b

Please sign in to comment.