fix(05-01): switch Vite alias to array syntax with RegExp find pattern
- Replace object alias syntax with array of {find, replacement} entries
- '@' and 'lexical' aliases preserved as string find entries
- OnboardingWizard alias uses RegExp /^\.\/components\/OnboardingWizard$/ find
- RegExp matches raw import specifier from App.tsx in both dev and prod modes
This commit is contained in:
parent
2e7a273687
commit
aba86d5a7c
1 changed files with 14 additions and 7 deletions
|
|
@ -6,13 +6,20 @@ import tailwindcss from "@tailwindcss/vite";
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react(), tailwindcss()],
|
plugins: [react(), tailwindcss()],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: [
|
||||||
"@": path.resolve(__dirname, "./src"),
|
{ find: "@", replacement: path.resolve(__dirname, "./src") },
|
||||||
lexical: path.resolve(__dirname, "./node_modules/lexical/Lexical.mjs"),
|
{
|
||||||
// [nexus] Replace upstream OnboardingWizard with Nexus single-step version
|
find: "lexical",
|
||||||
[path.resolve(__dirname, "src/components/OnboardingWizard")]:
|
replacement: path.resolve(__dirname, "./node_modules/lexical/Lexical.mjs"),
|
||||||
path.resolve(__dirname, "./src/components/NexusOnboardingWizard"),
|
},
|
||||||
},
|
// [nexus] Replace upstream OnboardingWizard with Nexus single-step version.
|
||||||
|
// RegExp required: string keys match the RAW import specifier (not resolved path).
|
||||||
|
// App.tsx imports './components/OnboardingWizard' — must match exactly.
|
||||||
|
{
|
||||||
|
find: /^\.\/components\/OnboardingWizard$/,
|
||||||
|
replacement: path.resolve(__dirname, "./src/components/NexusOnboardingWizard"),
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
port: 5173,
|
port: 5173,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue