@dynect/base 0.9.0 → 0.10.0
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/package.json +1 -1
- package/src/module.ts +16 -19
package/package.json
CHANGED
package/src/module.ts
CHANGED
|
@@ -78,25 +78,22 @@ export default defineNuxtModule<DynectBaseOptions>({
|
|
|
78
78
|
// @/components/ui/* → runtime/components/ui/*
|
|
79
79
|
// Must run BEFORE @ is resolved, so we use a regex alias in vite:extendConfig.
|
|
80
80
|
// Only applied when the consuming app has no own components/ui directory.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
// }
|
|
98
|
-
// });
|
|
99
|
-
// }
|
|
81
|
+
if (isStandalone && !existsSync(join(srcDir, 'components', 'ui'))) {
|
|
82
|
+
const uiRuntimePath = join(runtimeComponentsDir, 'ui');
|
|
83
|
+
|
|
84
|
+
nuxt.hook('vite:extendConfig', (config) => {
|
|
85
|
+
config.resolve ??= {};
|
|
86
|
+
|
|
87
|
+
const entry = { find: /^[@~]\/components\/ui/, replacement: uiRuntimePath };
|
|
88
|
+
|
|
89
|
+
if (Array.isArray(config.resolve.alias)) {
|
|
90
|
+
config.resolve.alias.unshift(entry);
|
|
91
|
+
} else {
|
|
92
|
+
const existing = config.resolve.alias ?? {};
|
|
93
|
+
config.resolve.alias = [entry, ...Object.entries(existing).map(([find, replacement]) => ({ find, replacement }))];
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
100
97
|
|
|
101
98
|
// ── Install required Nuxt modules ────────────────────────────────────────
|
|
102
99
|
if (options.shadcn !== false) {
|