You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm developing a framework where a file is generated at runtime called "data-models.ts". I have aliases to data-models.ts via "#data-models". Because the files which reference "#data-models" are within the node_modules directory when packaged, vite will not process these files to replace the alias.
Suggested solution
Allow vite to process specific files within node_modules with plugins.
@maitlandmarshall Can you provide an example project to show the alias issue? From a quick guess, it might be due to deps optimization and you might need to do optimizeDeps.exclude: ["your-package-which-uses-alias"].
@hi-ogawa thank you, that led me in the right direction to resolve my problem. I had to do this:
// Exclude @webui/lib from optimizeDeps so that the #data-models alias may be resolved
optimizeDeps: {
exclude: ["@webui/lib"],
include: ["@webui/lib > lodash", "@webui/lib > numeral", "@webui/lib > guid-typescript"]
},
Description
I'm developing a framework where a file is generated at runtime called "data-models.ts". I have aliases to data-models.ts via "#data-models". Because the files which reference "#data-models" are within the node_modules directory when packaged, vite will not process these files to replace the alias.
Suggested solution
Allow vite to process specific files within node_modules with plugins.
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: