zitejs 0.9.20 → 0.9.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/bundle/index.js
CHANGED
|
@@ -237,12 +237,16 @@ function createAliasPlugin(opts) {
|
|
|
237
237
|
return { path: 'zitejs/backend', external: true };
|
|
238
238
|
});
|
|
239
239
|
}
|
|
240
|
-
// Resolve zitejs/db to .zite/db.ts
|
|
240
|
+
// Resolve zitejs/db to .zite/db.ts — check app dir first, then
|
|
241
|
+
// workspace root (monorepo keeps db.ts at the project root).
|
|
241
242
|
build.onResolve({ filter: /^zitejs\/db$/ }, () => {
|
|
242
243
|
if (opts.baseDir) {
|
|
243
|
-
const
|
|
244
|
-
if (fs.existsSync(
|
|
245
|
-
return { path:
|
|
244
|
+
const appDbPath = path.resolve(opts.baseDir, '.zite/db.ts');
|
|
245
|
+
if (fs.existsSync(appDbPath))
|
|
246
|
+
return { path: appDbPath };
|
|
247
|
+
const rootDbPath = path.resolve(opts.baseDir, '../../.zite/db.ts');
|
|
248
|
+
if (fs.existsSync(rootDbPath))
|
|
249
|
+
return { path: rootDbPath };
|
|
246
250
|
}
|
|
247
251
|
return { path: 'zitejs/db', external: true };
|
|
248
252
|
});
|
package/dist/esm/bundle/index.js
CHANGED
|
@@ -201,12 +201,16 @@ function createAliasPlugin(opts) {
|
|
|
201
201
|
return { path: 'zitejs/backend', external: true };
|
|
202
202
|
});
|
|
203
203
|
}
|
|
204
|
-
// Resolve zitejs/db to .zite/db.ts
|
|
204
|
+
// Resolve zitejs/db to .zite/db.ts — check app dir first, then
|
|
205
|
+
// workspace root (monorepo keeps db.ts at the project root).
|
|
205
206
|
build.onResolve({ filter: /^zitejs\/db$/ }, () => {
|
|
206
207
|
if (opts.baseDir) {
|
|
207
|
-
const
|
|
208
|
-
if (fs.existsSync(
|
|
209
|
-
return { path:
|
|
208
|
+
const appDbPath = path.resolve(opts.baseDir, '.zite/db.ts');
|
|
209
|
+
if (fs.existsSync(appDbPath))
|
|
210
|
+
return { path: appDbPath };
|
|
211
|
+
const rootDbPath = path.resolve(opts.baseDir, '../../.zite/db.ts');
|
|
212
|
+
if (fs.existsSync(rootDbPath))
|
|
213
|
+
return { path: rootDbPath };
|
|
210
214
|
}
|
|
211
215
|
return { path: 'zitejs/db', external: true };
|
|
212
216
|
});
|