Path aliases with Vite

I am using meteor-vite and there is an issue filed for this question, in case it is a bug: Entry points not using Vite.resolve.alias definitions. · Issue #198 · JorgenVatle/meteor-vite · GitHub

And I notice a loosely related topic here: [Solved] Absolute path within meteor packages


Is there an accepted practice for using path aliases in import statements?

Both in the client and server applications, I would like to use aliases like @store/ or @ui/ as aliases, which works great with Vite ( see issue linked above for configuration file as it stands ) and at most required including duplicate references to match that in tsconfig.js ( also shown in the issue linked )

This seemed to be working before, and then something changed. Not sure whether it was me, or Meteor or Vite or meteor-vite or what. Opening up as general question with that in mind.

Thanks World!

@jorgenvatle resolved this! Thanks so much to the ninja :ninja:

Solution is using .babelrc with module-resolver

2 Likes