-
Notifications
You must be signed in to change notification settings - Fork 637
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: reconfigure CSS bundling (#2853)
* fix: reconfigure CSS bundling I've also added an E2E test group that gives us some basic monitoring for regressions in the CSS inclusion behavior. Closes #2847 * build: only distribute one copy of the css bundle We still generate all three copies, we just delete the extra ones at the end of the build process. * Reduce the number of builds --------- Co-authored-by: Robbie Wagner <rwwagner90@gmail.com>
- Loading branch information
1 parent
53ef038
commit cd50bb5
Showing
6 changed files
with
92 additions
and
66 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<html> | ||
<head> | ||
<script type="module"> | ||
import Shepherd from '../../node_modules/shepherd.js/dist/esm/shepherd.mjs'; | ||
window.Shepherd = Shepherd; | ||
</script> | ||
</head> | ||
|
||
<body> | ||
<div | ||
data-test-id="fake-modal-overlay" | ||
class="shepherd-modal-overlay-container" | ||
> | ||
</div> | ||
</body> | ||
</html> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<html> | ||
<head> | ||
<link | ||
rel="stylesheet" | ||
href="../../node_modules/shepherd.js/dist/css/shepherd.css" | ||
/> | ||
<script type="module"> | ||
import Shepherd from '../../node_modules/shepherd.js/dist/esm/shepherd.mjs'; | ||
window.Shepherd = Shepherd; | ||
</script> | ||
</head> | ||
|
||
<body> | ||
<div | ||
data-test-id="fake-modal-overlay" | ||
class="shepherd-modal-overlay-container" | ||
> | ||
</div> | ||
</body> | ||
</html> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* The `.shepherd-modal-overlay-container` class is chosen for inspection | ||
* because the Svelte styles for the modal are added to the import graph as | ||
* soon as Shepherd's JS is imported at all: | ||
* | ||
* shepherd.ts -> tour.ts -> components/shepherd-modal.svelte | ||
*/ | ||
describe('CSS Import Behavior', () => { | ||
it('includes project styles when explicitly imported', () => { | ||
cy.visit('/examples/css/with-css-import'); | ||
cy.window().should('have.property', 'Shepherd'); | ||
cy.get('[data-test-id="fake-modal-overlay"]').should('have.css', 'pointer-events', 'none'); | ||
}); | ||
|
||
it('DOES NOT include project styles without explicit import', () => { | ||
cy.visit('/examples/css/no-css-import'); | ||
cy.window().should('have.property', 'Shepherd'); | ||
cy.get('[data-test-id="fake-modal-overlay"]').should('not.have.css', 'pointer-events', 'none'); | ||
}); | ||
}); |