Subwaytime/vite-aliases

Cannot find module

Closed this issue · 1 comments

Hello,

I follow the installation guide and there is an error Cannot find module '@HelloWorld.vue' or its corresponding type declarations.

image

Is there any extra config needed in order to make this work?

Thank you

After reading more document, I need to set these two options to true for TypeScript.

ViteAliases({
	/**
	 * Generates paths in IDE config file
	 * works with JS or TS
	 * for Typescript: set `useTypescript` true
	 */
	useConfig: true,

	/**
	 * Will generate Paths in tsconfig
	 * used in combination with `useConfig`
	 */
	useTypescript: true,
})