Skip to content

bug(cli): #1323 refine serving logic for node modules plugin#1577

Draft
thescientist13 wants to merge 2 commits into
masterfrom
bug/refine-node-modules-plugin-serving
Draft

bug(cli): #1323 refine serving logic for node modules plugin#1577
thescientist13 wants to merge 2 commits into
masterfrom
bug/refine-node-modules-plugin-serving

Conversation

@thescientist13

@thescientist13 thescientist13 commented Sep 21, 2025

Copy link
Copy Markdown
Member

Related Issue

#1323

As part of exploring Bun support - thescientist13/greenwood-bun#5 (comment)

Documentation

N / A

Summary of Changes

  1. Make sure Node Modules resource plugin is only serving files from node_modules
  2. Misc plugin tweaks
    • standardize HTML resource plugin extension
    • check for Content-Type header first in Active Content resource plugin

TODO

  1. any chance this addresses restore custom loader and import attribute test case for Lit renderer plugin #1463 ?
  2. somewhat related, technically tsconfig.json supports JSON5, which means things like comments and dangling commas will break here (e.g. for Greenwood, a tsconfig.json will have to be JSON serializable)

@thescientist13 thescientist13 added this to the 1.0 milestone Sep 21, 2025
@thescientist13 thescientist13 added bug Something isn't working CLI alpha.0 v0.34.0 labels Sep 21, 2025
@thescientist13 thescientist13 moved this from 👀 In review to 🏗 In progress in [Greenwood] Phase 10 - Ecosystem Compat Sep 21, 2025
@thescientist13 thescientist13 marked this pull request as draft September 27, 2025 00:03
@thescientist13 thescientist13 marked this pull request as ready for review October 5, 2025 00:03
@thescientist13 thescientist13 marked this pull request as draft October 5, 2025 00:20
@thescientist13 thescientist13 linked an issue Oct 5, 2025 that may be closed by this pull request
@thescientist13 thescientist13 force-pushed the bug/refine-node-modules-plugin-serving branch from 9766d81 to b474f5d Compare February 2, 2026 00:37
@thescientist13 thescientist13 force-pushed the bug/refine-node-modules-plugin-serving branch from b474f5d to 2e883a2 Compare March 5, 2026 15:18
const { activeContent } = this.compilation.config;

return response.headers.get("Content-Type").indexOf(this.contentType[0]) >= 0 && activeContent;
return response.headers.get("Content-Type")?.indexOf(this.contentType[0]) >= 0 && activeContent;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

maybe this order should be reversed, so that we bail right away on the activeContent check, rather that doing the relatively larger check down through the headers.

@thescientist13 thescientist13 force-pushed the bug/refine-node-modules-plugin-serving branch from 2e883a2 to cc5a4d3 Compare June 27, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working CLI v0.35.0

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

Bun runtime support

1 participant