Skip to content

fix: copy co-located CSS into dist on build:lib - #28

Closed
danreed-rh wants to merge 2 commits into
mainfrom
26/include-colocated-css-build-lib
Closed

fix: copy co-located CSS into dist on build:lib#28
danreed-rh wants to merge 2 commits into
mainfrom
26/include-colocated-css-build-lib

Conversation

@danreed-rh

Copy link
Copy Markdown
Collaborator

Summary

  • After tsc, copy package-owned relative static assets (CSS, and other relative images/fonts if imported) from src/ into dist/ so npm consumers can resolve import './Foo.css' without shipping src/.
  • Add check:lib-assets, mark **/*.css as sideEffects, run build:lib in frontend CI, and document the library consume path in the README.
  • Closes Include co-located CSS in build:lib for npm consumers #26

Why

build:lib only ran tsc + tsc-alias. Emitted JS kept relative CSS imports, but the CSS files were not in dist/. With "files": ["dist", …], that breaks consumers after publish.

Test plan

  • cd frontend && rm -rf dist && npm run build:lib
  • Confirm dist/components/sandbox/SandboxCard.css and SandboxEgressSummary.css exist
  • npm run check:lib-assets passes
  • npm pack --dry-run lists both CSS files under dist/
  • CI check-frontend runs build:lib on this PR

danreed-rh and others added 2 commits August 7, 2026 15:31
tsc leaves relative CSS imports in emitted JS but does not copy the
files. Post-build asset copy keeps the publishable package self-contained
for npm consumers (#26).

Co-authored-by: Cursor <cursoragent@cursor.com>
Narrow sideEffects caused webpack to drop cypress/support/commands.ts,
so cy.login was undefined in e2e. Not required for #26 CSS-in-dist.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Gkrumbach07

Copy link
Copy Markdown
Owner

PR #25 solves this by deleting the CSS files entirely — co-located CSS breaks PF theming in Module Federation, so we don't want them in the build at all. Going to close this in favor of that approach.

@danreed-rh danreed-rh closed this Aug 10, 2026
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.

Include co-located CSS in build:lib for npm consumers

2 participants