When I setup Vite to load components using absolute path I get this MIME type not allowed console error.
vite.config.js:
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
const path = require('path');
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
resolve: {
alias: [{ find: '@', replacement: path.resolve(__dirname, '/src') }]
}
});
jsconfig.json
{
"compilerOptions": {
"jsx": "preserve",
"baseUrl": "./src",
"paths": {
"@/*": ["*"]
}
}
}
import:
import Container from '@/Components/UI/Container/Container';

Any solution?
<script></script>tag in theindex.htmlfile to be sure that he is not missing thetypeattribute from the script tag.