Open cdll opened 1 year ago
the code below seems not working :
// vite.config.ts export default defineConfig({ vitApp({ // vit configs ... }), // some other vite configs ... resolve: { alias: { "~/": path.resolve(__dirname, "./"), "~": path.resolve(__dirname, "./node_modules/"), "@/": path.resolve(__dirname, "/src/"), "~@/": path.resolve(__dirname, "/src/"), "lodash": 'lodash-es', "~antd": path.resolve(__dirname, "./node_modules/antd/"), }, }, })
vitApp config should place in plugins. resolve.alias is Vite supported, not vitjs. On the other hand, you can try https://www.npmjs.com/package/vite-tsconfig-paths instead of manual configuration.
vitApp
resolve.alias
the code below seems not working :