Skip to content

Commit 753bd3b

Browse files
committed
fix: add optimize deps hach in the plugin
1 parent 85fea6d commit 753bd3b

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

cmp/compiler/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
"tsdown": "^0.16.5",
144144
"tsx": "^4.19.2",
145145
"typescript": "^5.9.3",
146-
"unplugin": "^2.3.10",
146+
"unplugin": "^2.3.11",
147147
"vitest": "^4.0.13"
148148
},
149149
"dependencies": {

cmp/compiler/src/plugin/unplugin.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,15 @@ export const lingoUnplugin = createUnplugin<
136136
enforce: "pre", // Run before other plugins (especially before React plugin)
137137

138138
vite: {
139+
// Vite handles deep merge
140+
config() {
141+
// Required for custom virtual like modules to be resolved; otherwise they are bundled with raw source code.
142+
return {
143+
optimizeDeps: {
144+
exclude: ["@lingo.dev/compiler"],
145+
},
146+
};
147+
},
139148
async buildStart() {
140149
const metadataFilePath = getMetadataPath();
141150

cmp/demo/vite-react-spa/vite.config.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ export default defineConfig({
2929
viteReact(),
3030
tailwindcss(),
3131
],
32-
optimizeDeps: {
33-
exclude: ["@lingo.dev/compiler"],
34-
},
3532
resolve: {
3633
alias: {
3734
"@": fileURLToPath(new URL("./src", import.meta.url)),

0 commit comments

Comments
 (0)