Skip to content

Commit

Permalink
fix: Fix css not injected into index.cjs
Browse files Browse the repository at this point in the history
  • Loading branch information
tjtanjin committed Mar 29, 2024
1 parent 1e9771d commit 8ad4ac1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
"typescript": "^5.1.6",
"vite": "^4.5.2",
"vite-plugin-dts": "^3.4.0",
"vite-plugin-libcss": "^1.1.1",
"vite-plugin-svgr": "^3.2.0"
},
"browserslist": {
Expand Down
6 changes: 3 additions & 3 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import react from "@vitejs/plugin-react";
import svgr from "vite-plugin-svgr";
import dts from "vite-plugin-dts";
import path from "path";
import libCss from "vite-plugin-libcss";

import { defineConfig } from "vite";

Expand All @@ -21,10 +20,12 @@ export default defineConfig({
globals: {
react: "React",
},
// todo: deprecate and remove in 2.0.0, breaking change!
assetFileNames: (assetInfo) => {
if (assetInfo.name === "style.css") return "react-chatbotify.css";
return assetInfo.name;
},
intro: 'import "./react-chatbotify.css";',
},
},
outDir: "../dist",
Expand All @@ -39,8 +40,7 @@ export default defineConfig({
react({
include: "**/*.{jsx,tsx}",
}),
dts(),
libCss(),
dts()
],
server: {
port: 3000,
Expand Down

0 comments on commit 8ad4ac1

Please sign in to comment.