79271034

Date: 2024-12-11 08:50:27
Score: 1.5
Natty:
Report link

@AlbertDugba

i found solution by trying this on the vite react app, where i am using the tailwind css and then make a build with minifed version of the JS file with the tailwind css classes, see my vite.config.ts

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js";

export default defineConfig({
  plugins: [
    react(),
    cssInjectedByJsPlugin({
      relativeCSSInjection: true,
    }),
  ],
  build: {
    rollupOptions: { output: { manualChunks: undefined } },
    minify: true,
  },
  server: {
    host: "localhost",
    port: 3000,
  },
});
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @AlbertDugba
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Junaid