build css into individual js files instead of using css links. Vite >= 3.1
npm install vite-plugin-include-css --save-dev
import { defineConfig } from 'vite';
import includeCSS from 'vite-plugin-include-css';
export default defineConfig({
plugins: [
includeCSS()
],
build: {
cssCodeSplit: false,
rollupOptions: {
output: {
manualChunks: undefined,
assetFileNames: 'assets/[name][extname]',
entryFileNames: '[name].js',
format: 'iife'
}
}
}
});