Closed cawa-93 closed 3 years ago
In vite@2
, Rollup plugins are valid Vite plugins, so you could try one of them if you'd like:
https://www.npmjs.com/search?q=rollup%20typescript%20paths
Otherwise, PR welcome!
I'm working on upgrading vite-tsconfig-paths
to work with vite@2
, since none of the Rollup plugins use the tsconfig-paths
package like I do. I'm planning on using the root
option from vite.config.js as the directory to search for tsconfig.json. Will that work for your use case?
Nope. In my case, there are several entry points, they have their own tsconfig and they are all deeper than the root.
@cawa-93 Ah ok. You said they each have their own vite.config.js, but I suppose the root
is still defaulting to process.cwd()
for each of them.
If you install vite-tsconfig-paths@next
and vite@next
, you can do this:
import tsconfigPaths from 'vite-tsconfig-paths'
export default {
plugins: [
tsconfigPaths({ root: __dirname }),
]
}
I'm working on template for creating electron applications. In
src
are several entry points. Each has its owntsconfig
andvite.config
. And notsconfig
is at the root of the project.