I'm trying to replace vue-cli with vite. I have a vite.config.js so I can use alias for imports:
export default {
alias: {
'@': require('path').resolve(__dirname, 'src'),
},
};
Then in my main.ts I try to import my css file (I tried it with or without the .module
:
import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
import '@/assets/app.module.css';
createApp(App).use(router).mount('#app');
But I get this error:
[vite] Failed to resolve module import "@/assets/app.module.css". (imported by /src/main.ts)
What am I doing wrong?
According to those code lines
so try out :