DEV Community

loading...

Discussion on: Vite.js + Vue 3 + router + vuex + tailwindcss template

Collapse
fullzero5 profile image
FullZero • Edited

Hi, tell me I didn't see how to add an alias @?

resolvers: [
    {
      alias: [
        {
          '@': path.resolve(__dirname, './src'),
        }
      ]
    },
]
Enter fullscreen mode Exit fullscreen mode

does not work

Collapse
jarraga profile image
Jorge Arraga Author

Hi! your vite.config.js should look like this:

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'

export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      '@': resolve(__dirname, './src')
    }
  }
})
Enter fullscreen mode Exit fullscreen mode

Tell me if it works!

Collapse
fullzero5 profile image
FullZero

Thanks!

Forem Open with the Forem app