@acmekit/docs-bundler 2.13.46 → 2.13.48

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/index.js CHANGED
@@ -463,12 +463,41 @@ async function getViteConfig(options) {
463
463
  return null;
464
464
  }
465
465
  };
466
+ const resolveDocsPackageDir = (pkg) => {
467
+ try {
468
+ return import_path3.default.dirname(require.resolve(`${pkg}/package.json`));
469
+ } catch {
470
+ return null;
471
+ }
472
+ };
473
+ const docsAppDir = resolveDocsPackageDir("@acmekit/docs-app");
474
+ const docsSharedDir = resolveDocsPackageDir("@acmekit/docs-shared");
475
+ const docsAliases = [];
476
+ if (docsAppDir) {
477
+ try {
478
+ docsAliases.push({
479
+ find: "@acmekit/docs-app/entry-server",
480
+ replacement: require.resolve("@acmekit/docs-app/entry-server")
481
+ });
482
+ } catch {
483
+ }
484
+ docsAliases.push({ find: "@acmekit/docs-app", replacement: docsAppDir });
485
+ }
486
+ if (docsSharedDir) {
487
+ docsAliases.push({
488
+ find: "@acmekit/docs-shared",
489
+ replacement: docsSharedDir
490
+ });
491
+ }
466
492
  const watchPackages = ["@acmekit/docs-ui", "@acmekit/docs-app"];
467
493
  const watchDirs = watchPackages.map((pkg) => resolvePackageDist(pkg)).filter(Boolean);
468
494
  const baseConfig = {
469
495
  root,
470
496
  base: options.path,
471
497
  cacheDir: import_path3.default.resolve(process.cwd(), "node_modules/.vite/acmekit-docs"),
498
+ resolve: {
499
+ alias: docsAliases
500
+ },
472
501
  build: {
473
502
  emptyOutDir: true,
474
503
  outDir: import_path3.default.resolve(process.cwd(), options.outDir)
package/dist/index.mjs CHANGED
@@ -432,12 +432,41 @@ async function getViteConfig(options) {
432
432
  return null;
433
433
  }
434
434
  };
435
+ const resolveDocsPackageDir = (pkg) => {
436
+ try {
437
+ return path3.dirname(__require.resolve(`${pkg}/package.json`));
438
+ } catch {
439
+ return null;
440
+ }
441
+ };
442
+ const docsAppDir = resolveDocsPackageDir("@acmekit/docs-app");
443
+ const docsSharedDir = resolveDocsPackageDir("@acmekit/docs-shared");
444
+ const docsAliases = [];
445
+ if (docsAppDir) {
446
+ try {
447
+ docsAliases.push({
448
+ find: "@acmekit/docs-app/entry-server",
449
+ replacement: __require.resolve("@acmekit/docs-app/entry-server")
450
+ });
451
+ } catch {
452
+ }
453
+ docsAliases.push({ find: "@acmekit/docs-app", replacement: docsAppDir });
454
+ }
455
+ if (docsSharedDir) {
456
+ docsAliases.push({
457
+ find: "@acmekit/docs-shared",
458
+ replacement: docsSharedDir
459
+ });
460
+ }
435
461
  const watchPackages = ["@acmekit/docs-ui", "@acmekit/docs-app"];
436
462
  const watchDirs = watchPackages.map((pkg) => resolvePackageDist(pkg)).filter(Boolean);
437
463
  const baseConfig = {
438
464
  root,
439
465
  base: options.path,
440
466
  cacheDir: path3.resolve(process.cwd(), "node_modules/.vite/acmekit-docs"),
467
+ resolve: {
468
+ alias: docsAliases
469
+ },
441
470
  build: {
442
471
  emptyOutDir: true,
443
472
  outDir: path3.resolve(process.cwd(), options.outDir)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@acmekit/docs-bundler",
3
3
  "description": "Build and serve AcmeKit documentation.",
4
- "version": "2.13.46",
4
+ "version": "2.13.48",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.mjs",
@@ -19,11 +19,11 @@
19
19
  "test": "yarn run -T vitest --run"
20
20
  },
21
21
  "dependencies": {
22
- "@acmekit/docs-app": "^2.13.46",
23
- "@acmekit/docs-shared": "^2.13.46",
24
- "@acmekit/docs-tailwind": "^2.13.46",
25
- "@acmekit/docs-ui": "^2.13.46",
26
- "@acmekit/docs-vite-plugin": "^2.13.46",
22
+ "@acmekit/docs-app": "^2.13.48",
23
+ "@acmekit/docs-shared": "^2.13.48",
24
+ "@acmekit/docs-tailwind": "^2.13.48",
25
+ "@acmekit/docs-ui": "^2.13.48",
26
+ "@acmekit/docs-vite-plugin": "^2.13.48",
27
27
  "@mdx-js/rollup": "^3.0.0",
28
28
  "@vitejs/plugin-react": "^4.3.0",
29
29
  "compression": "^1.7.4",