diff options
Diffstat (limited to 'packages/integrations')
-rw-r--r-- | packages/integrations/lit/package.json | 3 | ||||
-rw-r--r-- | packages/integrations/lit/server-shim.js | 2 | ||||
-rw-r--r-- | packages/integrations/lit/test/sass.test.js | 14 |
3 files changed, 18 insertions, 1 deletions
diff --git a/packages/integrations/lit/package.json b/packages/integrations/lit/package.json index 6f6bbdb70..730a1bd41 100644 --- a/packages/integrations/lit/package.json +++ b/packages/integrations/lit/package.json @@ -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", diff --git a/packages/integrations/lit/server-shim.js b/packages/integrations/lit/server-shim.js index 054679592..0c1fde383 100644 --- a/packages/integrations/lit/server-shim.js +++ b/packages/integrations/lit/server-shim.js @@ -3,3 +3,5 @@ installWindowOnGlobal(); window.global = window; document.getElementsByTagName = () => []; +// See https://github.com/lit/lit/issues/2393 +document.currentScript = null; diff --git a/packages/integrations/lit/test/sass.test.js b/packages/integrations/lit/test/sass.test.js new file mode 100644 index 000000000..9bc039db6 --- /dev/null +++ b/packages/integrations/lit/test/sass.test.js @@ -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; + }); +}); |