Skip to content

Commit

Permalink
fix(#2623, #3508): patch lit server shim to allow sass compat
Browse files Browse the repository at this point in the history
  • Loading branch information
Nate Moore committed Jun 2, 2022
1 parent c6e7355 commit 0f5a2a4
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/integrations/lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"devDependencies": {
"astro": "workspace:*",
"astro-scripts": "workspace:*",
"cheerio": "^1.0.0-rc.11"
"cheerio": "^1.0.0-rc.11",
"sass": "^1.52.1"
},
"peerDependencies": {
"@webcomponents/template-shadowroot": "^0.1.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/integrations/lit/server-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ installWindowOnGlobal();

window.global = window;
document.getElementsByTagName = () => [];
// See https://github.com/lit/lit/issues/2393
document.currentScript = null;
14 changes: 14 additions & 0 deletions packages/integrations/lit/test/sass.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { expect } from 'chai';

describe('check', () => {
it('should be able to load sass', async () => {
let error = null;
try {
await import(new URL('../server-shim.js', import.meta.url));
await import('sass');
} catch (e) {
error = e;
}
expect(error).to.be.null;
});
});
11 changes: 11 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0f5a2a4

Please sign in to comment.