fix: copy co-located CSS into dist on build:lib - #28
Closed
danreed-rh wants to merge 2 commits into
Closed
Conversation
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>
3 tasks
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tsc, copy package-owned relative static assets (CSS, and other relative images/fonts if imported) fromsrc/intodist/so npm consumers can resolveimport './Foo.css'without shippingsrc/.check:lib-assets, mark**/*.cssassideEffects, runbuild:libin frontend CI, and document the library consume path in the README.build:libfor npm consumers #26Why
build:libonly rantsc+tsc-alias. Emitted JS kept relative CSS imports, but the CSS files were not indist/. With"files": ["dist", …], that breaks consumers after publish.Test plan
cd frontend && rm -rf dist && npm run build:libdist/components/sandbox/SandboxCard.cssandSandboxEgressSummary.cssexistnpm run check:lib-assetspassesnpm pack --dry-runlists both CSS files underdist/check-frontendrunsbuild:libon this PR