Missing CSS File for One Entry Point in Vite MPA Build #14311
Unanswered
yokotak0527
asked this question in
Q&A
Replies: 2 comments
-
|
Did you ever figure this out? I'm seeing something pretty similar |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Seeing similar. Multiple entry points. One has the CSS bundled, the other doesn't |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I'm working on a Multi-Page Application (MPA) using Vite and facing an issue where a CSS file is not generated for one of my entry points (index.tsx), although it's generated for the other (sub.tsx). Both entry points use the same Text component that utilizes CSS Modules.
Environment
Details
Below are the related files.
package.json
{ "name": "app", "version": "1.0.0", "description": "", "engines": { "node": "18.X", "npm": "9.X" }, "scripts": { "build": "tsc && vite build", "dev": "vite build -m development" }, "license": "UNLICENSED", "dependencies": { "react": "18.2.0", "@types/node": "20.5.9", "@types/react": "18.2.21", "@types/react-dom": "18.2.7", "@vitejs/plugin-react": "4.0.4", "glob": "10.3.4", "react-dom": "18.2.0", "typescript": "5.2.2", "vite": "4.4.9", "vite-tsconfig-paths": "4.2.0" } }vite.config.ts
tsconfig.json
{ "compilerOptions": { "rootDir": "./", "baseUrl": "src", "target": "ES2020", "useDefineForClassFields": true, "module": "ESNext", "moduleResolution": "bundler", "skipLibCheck": true, "allowImportingTsExtensions": true, "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", "allowJs": true, "checkJs": true, "strict": true, "noUnusedLocals": false, "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, "allowSyntheticDefaultImports": true, "lib": [ "ESNext", "DOM", "DOM.Iterable" ] }, "include": [ "src", "vite.config.ts" ] }src/entrypoints/index.tsx and sub.tsx
index.tsx and sub.tsx is identical to simplify the issue. The point I'd like you to focus on is that the same component is being imported in multiple entry points.
src/components/Text.tsx
I've also made the code available on GitHub for easier reproduction:
https://github.com/yokotak0527/vite-issue-230906
Questions
Any advice would be greatly appreciated. Thank you.
Beta Was this translation helpful? Give feedback.
All reactions