React templates: Move *.css imports into components #693

Closed
opened 2025-08-09 17:17:18 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @stephtr on 6/1/2017

At the moment one (or more) css files in ClientApp/css/ get imported by boot-client.tsx and not in boot-server.tsx.
Wouldn't it be better to import the css files in the corresponding ClientApp/components/ files, such that for example there is a NavMenu.css file which gets imported by NavMenu.tsx?
The only other change necessary would be to add a { test: /\.css$/, use: 'ignore-loader' } to the server bundle's rules.

*Originally created by @stephtr on 6/1/2017* At the moment one (or more) css files in ClientApp/css/ get imported by boot-client.tsx and not in boot-server.tsx. Wouldn't it be better to import the css files in the corresponding ClientApp/components/ files, such that for example there is a NavMenu.css file which gets imported by NavMenu.tsx? The only other change necessary would be to add a `{ test: /\.css$/, use: 'ignore-loader' }` to the server bundle's rules.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#693
No description provided.