Patch Lit server shim to fix sass compatability (#3511)
* fix(#2623, #3508): patch lit server shim to allow sass compat * chore: add changeset
This commit is contained in:
parent
a74cf98002
commit
2fedb97489
5 changed files with 34 additions and 1 deletions
5
.changeset/famous-pens-cheer.md
Normal file
5
.changeset/famous-pens-cheer.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@astrojs/lit': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Patch Lit's server shim to allow for `sass` compatability
|
|
@ -37,7 +37,8 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"astro": "workspace:*",
|
"astro": "workspace:*",
|
||||||
"astro-scripts": "workspace:*",
|
"astro-scripts": "workspace:*",
|
||||||
"cheerio": "^1.0.0-rc.11"
|
"cheerio": "^1.0.0-rc.11",
|
||||||
|
"sass": "^1.52.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@webcomponents/template-shadowroot": "^0.1.0",
|
"@webcomponents/template-shadowroot": "^0.1.0",
|
||||||
|
|
|
@ -3,3 +3,5 @@ installWindowOnGlobal();
|
||||||
|
|
||||||
window.global = window;
|
window.global = window;
|
||||||
document.getElementsByTagName = () => [];
|
document.getElementsByTagName = () => [];
|
||||||
|
// See https://github.com/lit/lit/issues/2393
|
||||||
|
document.currentScript = null;
|
||||||
|
|
14
packages/integrations/lit/test/sass.test.js
Normal file
14
packages/integrations/lit/test/sass.test.js
Normal file
|
@ -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;
|
||||||
|
});
|
||||||
|
});
|
|
@ -1665,12 +1665,14 @@ importers:
|
||||||
astro: workspace:*
|
astro: workspace:*
|
||||||
astro-scripts: workspace:*
|
astro-scripts: workspace:*
|
||||||
cheerio: ^1.0.0-rc.11
|
cheerio: ^1.0.0-rc.11
|
||||||
|
sass: ^1.52.1
|
||||||
dependencies:
|
dependencies:
|
||||||
'@lit-labs/ssr': 2.2.0
|
'@lit-labs/ssr': 2.2.0
|
||||||
devDependencies:
|
devDependencies:
|
||||||
astro: link:../../astro
|
astro: link:../../astro
|
||||||
astro-scripts: link:../../../scripts
|
astro-scripts: link:../../../scripts
|
||||||
cheerio: 1.0.0-rc.11
|
cheerio: 1.0.0-rc.11
|
||||||
|
sass: 1.52.1
|
||||||
|
|
||||||
packages/integrations/netlify:
|
packages/integrations/netlify:
|
||||||
specifiers:
|
specifiers:
|
||||||
|
@ -8059,6 +8061,11 @@ packages:
|
||||||
|
|
||||||
/debug/3.2.7:
|
/debug/3.2.7:
|
||||||
resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==}
|
resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==}
|
||||||
|
peerDependencies:
|
||||||
|
supports-color: '*'
|
||||||
|
peerDependenciesMeta:
|
||||||
|
supports-color:
|
||||||
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
ms: 2.1.3
|
ms: 2.1.3
|
||||||
dev: false
|
dev: false
|
||||||
|
@ -10990,6 +10997,8 @@ packages:
|
||||||
debug: 3.2.7
|
debug: 3.2.7
|
||||||
iconv-lite: 0.4.24
|
iconv-lite: 0.4.24
|
||||||
sax: 1.2.4
|
sax: 1.2.4
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- supports-color
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/netmask/2.0.2:
|
/netmask/2.0.2:
|
||||||
|
@ -11073,6 +11082,8 @@ packages:
|
||||||
rimraf: 2.7.1
|
rimraf: 2.7.1
|
||||||
semver: 5.7.1
|
semver: 5.7.1
|
||||||
tar: 4.4.19
|
tar: 4.4.19
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- supports-color
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/node-releases/2.0.5:
|
/node-releases/2.0.5:
|
||||||
|
|
Loading…
Reference in a new issue