Skip to content

Conversation

@hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa changed the title refactor(rsc): check ModuleNode.type instead of extension refactor(rsc): check module node type instead of extension Jul 28, 2025
for (const next of mod?.importedModules ?? []) {
if (next.id) {
if (isCSSRequest(next.id)) {
if (next.type === 'css') {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like css is actually type: 'js' 🤔

EnvironmentModuleNode {
  environment: 'rsc',
  url: '/src/index.css',
  id: '/home/hiroshi/code/others/vite-plugin-react/packages/plugin-rsc/examples/starter/src/index.css',
  file: '/home/hiroshi/code/others/vite-plugin-react/packages/plugin-rsc/examples/starter/src/index.css',
  type: 'js',
  info: undefined,
  meta: undefined,
  importers: Set(1) {
    EnvironmentModuleNode {
      environment: 'rsc',
      url: '/src/root.tsx',
      id: '/home/hiroshi/code/others/vite-plugin-react/packages/plugin-rsc/examples/starter/src/root.tsx',
      file: '/home/hiroshi/code/others/vite-plugin-react/packages/plugin-rsc/examples/starter/src/root.tsx',
      type: 'js',

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hi-ogawa
Copy link
Contributor Author

It looks like I misunderstood module type. type: 'css' is for .css?direct request which holds raw css text string instead of export default '...' string.

@hi-ogawa hi-ogawa closed this Jul 28, 2025
@hi-ogawa hi-ogawa deleted the 07-28-refactor_rsc_check_modulenode.type_instead_of_extension branch July 28, 2025 06:16
@hi-ogawa hi-ogawa restored the 07-28-refactor_rsc_check_modulenode.type_instead_of_extension branch July 28, 2025 06:23
@hi-ogawa hi-ogawa reopened this Jul 28, 2025
@hi-ogawa hi-ogawa closed this Jul 28, 2025
@hi-ogawa hi-ogawa deleted the 07-28-refactor_rsc_check_modulenode.type_instead_of_extension branch July 28, 2025 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace isCSSRequest check with moduleNode.type === 'css'

1 participant