vite-aliases: 0.97 - Can't use vite-aliases

ERROR: [plugin: externalize-deps] Failed to resolve entry for package "vite-aliases". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." entry in "vite-aliases" package

I think you need to change package.json and how tsup compile tho. I’ll send you a PR

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 21 (5 by maintainers)

Most upvoted comments

@thisVioletHydra do you have the error report for when your postcss crashed ?

Most probably it has nothing to do with vite-aliases but the implemenation of vite ( https://github.com/vitejs/vite/issues/10192 )

update : Don’t use postcss.config.ts since it won’t work with vite and esm. maybe you could use postcss.config.mjs instead

adding "type":"mofule" fixed the issue for me 👍🏽

I will close this issue since it’s need to be more specific and the discussion is widening.

@thisVioletHydra This has already been reported upwards, you need to add "type":"module" to your package.json, as the latest version moved entirely to ESM.

@nichita-pasecinic i deleted the comment, as thats not part of the conversation. Vite-aliases is meant for bigger projects where having distinct aliases per folder is important for managing and organizing the code base. Having one alias is totally fine but it also just turns your aliases into an entire path.

@nichita-pasecinic these look like two different errors, so ill fix them seperately! Thanks for the report

@Subwaytime thanks bro, tbh vite-aliases helping me big time for years before vite 3 came and ruin everything.

And thanks to your plugin, I had an idea to build yet-another-front-end starter kit using solidjs, will sponsor you next month.

Ill have a look! Thanks for the report 😃