unbuild icon indicating copy to clipboard operation
unbuild copied to clipboard

alias support from tsconfig

Open pi0 opened this issue 4 years ago • 4 comments

pi0 avatar Apr 07 '21 17:04 pi0

Would this feature allow importing from #app (i.e. defineNuxtPlugin, useState, etc) inside a Nuxt module built with unbuild ? Or is this already possible with unbuild ?

lewebsimple avatar Oct 31 '21 00:10 lewebsimple

You should never import from #app in a nuxt module

pi0 avatar Nov 02 '21 10:11 pi0

How about importing from #app inside a plugin template in a Nuxt module ?

lewebsimple avatar Nov 02 '21 11:11 lewebsimple

Sure that is possible but for runtime files like plugins, we use mkdist that transpiles them file-by-file and without resolving aliases. (see this example)

I will add a better starter template soon. Sorry for lack of it at the moment!

pi0 avatar Nov 02 '21 11:11 pi0

Thinking more, using tsConfig with side effects is not the best idea to infer aliases. Using build.config seems best.

pi0 avatar Jul 18 '23 17:07 pi0