Skip to content

Conversation

Copy link

Copilot AI commented Jan 21, 2026

This PR was created to address review feedback on #66 regarding the use of 'undefined' in cssModulesValues array (lines 403-426 in loaderBridge.ts).

Analysis

The review flagged that the string 'undefined' would be truthy and not filtered by .filter(Boolean). However, the code generates JavaScript source code as strings:

const cssModulesValues = cssRequests.map((request, index) =>
  isCssModuleRequest(request)
    ? `__knightedStyle${index}.knightedCssModules`
    : 'undefined',
)

When joined into the template (line 424-426), 'undefined' becomes the literal undefined in the generated JavaScript:

// Generated code:
const __knightedCssModules = Object.assign({}, ...[
  __knightedLocalsExport ?? __knightedResolveCssModules(__knightedDefault, __knightedUpstream),
  __knightedStyle0.knightedCssModules,
  undefined,  // This is the JavaScript literal, not the string 'undefined'
  __knightedStyle2.knightedCssModules
].filter(Boolean));

The literal undefined is falsy and correctly filtered out by .filter(Boolean).

Conclusion

Original implementation is correct. No changes required.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] WIP address feedback on dependency graph resolution Address feedback on dependency graph resolution - no changes needed Jan 21, 2026
Base automatically changed from bananas to main January 21, 2026 16:45
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.

2 participants