Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is vit support vite's resolve.alias ? #11

Open
cdll opened this issue Aug 7, 2023 · 1 comment
Open

is vit support vite's resolve.alias ? #11

cdll opened this issue Aug 7, 2023 · 1 comment

Comments

@cdll
Copy link

cdll commented Aug 7, 2023

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/"),
    },
  },
})
@cdll cdll changed the title is vit support vites' resolve.alias ? is vit support vite's resolve.alias ? Aug 7, 2023
@yunsii
Copy link
Member

yunsii commented Aug 7, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants