summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Arsh <69170106+lilnasy@users.noreply.github.com> 2023-08-18 12:22:06 +0530
committerGravatar GitHub <noreply@github.com> 2023-08-18 07:52:06 +0100
commit8a5b0c1f3a4be6bb62db66ec70144109ff5b4c59 (patch)
tree3db98f0de0742ff5edf02b3b8f40e89375c3a561
parent2540feedb06785d5a20eecc3668849f147d778d4 (diff)
downloadastro-8a5b0c1f3a4be6bb62db66ec70144109ff5b4c59.tar.gz
astro-8a5b0c1f3a4be6bb62db66ec70144109ff5b4c59.tar.zst
astro-8a5b0c1f3a4be6bb62db66ec70144109ff5b4c59.zip
Switch `build.inlineStylesheets` default to auto (#8118)
* switch inlineStylesheets default * use previous default for astro/test * use previous default for content-collections-render.test.js * integrations: node, deno, mdx, markdown * typedocs: switch inlineStylesheets default * Update example to show non-default * add changeset * reword changeset --------- Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
-rw-r--r--.changeset/smart-numbers-shout.md19
-rw-r--r--packages/astro/src/@types/astro.ts4
-rw-r--r--packages/astro/src/core/config/schema.ts2
-rw-r--r--packages/astro/test/alias-tsconfig-baseurl-only.test.js2
-rw-r--r--packages/astro/test/alias-tsconfig.test.js2
-rw-r--r--packages/astro/test/asset-url-base.test.js4
-rw-r--r--packages/astro/test/astro-client-only.test.js4
-rw-r--r--packages/astro/test/astro-css-bundling.test.js5
-rw-r--r--packages/astro/test/astro-directives.test.js6
-rw-r--r--packages/astro/test/astro-head.test.js2
-rw-r--r--packages/astro/test/build-assets.test.js6
-rw-r--r--packages/astro/test/component-library.test.js2
-rw-r--r--packages/astro/test/config-vite-css-target.test.js6
-rw-r--r--packages/astro/test/config-vite.test.js6
-rw-r--r--packages/astro/test/content-collections-render.test.js4
-rw-r--r--packages/astro/test/css-import-as-inline.test.js2
-rw-r--r--packages/astro/test/css-no-code-split.test.js6
-rw-r--r--packages/astro/test/css-order-import.test.js4
-rw-r--r--packages/astro/test/css-order-layout.test.js2
-rw-r--r--packages/astro/test/css-order.test.js2
-rw-r--r--packages/astro/test/glob-pages-css.test.js2
-rw-r--r--packages/astro/test/head-injection.test.js2
-rw-r--r--packages/astro/test/lazy-layout.test.js6
-rw-r--r--packages/astro/test/minification-html.test.js8
-rw-r--r--packages/astro/test/page-level-styles.test.js2
-rw-r--r--packages/astro/test/postcss.test.js2
-rw-r--r--packages/astro/test/remote-css.test.js2
-rw-r--r--packages/astro/test/root-srcdir-css.test.js2
-rw-r--r--packages/astro/test/scoped-style-strategy.test.js6
-rw-r--r--packages/astro/test/ssr-404-500-pages.test.js2
-rw-r--r--packages/astro/test/ssr-assets.test.js2
-rw-r--r--packages/astro/test/ssr-dynamic.test.js2
-rw-r--r--packages/astro/test/ssr-manifest.test.js2
-rw-r--r--packages/astro/test/ssr-split-manifest.test.js2
-rw-r--r--packages/astro/test/static-build.test.js2
-rw-r--r--packages/astro/test/virtual-astro-file.test.js6
-rw-r--r--packages/integrations/deno/test/basics.test.ts11
-rw-r--r--packages/integrations/markdoc/test/propagated-assets.test.js2
-rw-r--r--packages/integrations/mdx/test/css-head-mdx.test.js2
-rw-r--r--packages/integrations/mdx/test/mdx-page.test.js2
-rw-r--r--packages/integrations/node/test/prerender-404-500.test.js2
41 files changed, 141 insertions, 18 deletions
diff --git a/.changeset/smart-numbers-shout.md b/.changeset/smart-numbers-shout.md
new file mode 100644
index 000000000..4d5083862
--- /dev/null
+++ b/.changeset/smart-numbers-shout.md
@@ -0,0 +1,19 @@
+---
+'astro': patch
+---
+
+Astro is smarter about CSS! Small stylesheets are now inlined by default, and no longer incur the cost of additional requests to your server. Your visitors will have to wait less before they see your pages, especially those in remote locations or in a subway.
+
+This may not be news to you if you had opted-in via the `build.inlineStylesheets` configuration. Stabilized in Astro 2.6 and set to "auto" by default for Starlight, this configuration allows you to reduce the number of requests for stylesheets by inlining them into <style> tags. The new default is "auto", which selects assets smaller than 4kB and includes them in the initial response.
+
+To go back to the previous default behavior, change `build.inlineStylesheets` to "never".
+
+```ts
+import { defineConfig } from 'astro/config';
+
+export default defineConfig({
+ build: {
+ inlineStylesheets: 'never',
+ },
+});
+```
diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts
index 0449b89d4..422f37bcd 100644
--- a/packages/astro/src/@types/astro.ts
+++ b/packages/astro/src/@types/astro.ts
@@ -836,7 +836,7 @@ export interface AstroUserConfig {
* @docs
* @name build.inlineStylesheets
* @type {('always' | 'auto' | 'never')}
- * @default `never`
+ * @default `auto`
* @version 2.6.0
* @description
* Control whether project styles are sent to the browser in a separate css file or inlined into `<style>` tags. Choose from the following options:
@@ -847,7 +847,7 @@ export interface AstroUserConfig {
* ```js
* {
* build: {
- * inlineStylesheets: `auto`,
+ * inlineStylesheets: `never`,
* },
* }
* ```
diff --git a/packages/astro/src/core/config/schema.ts b/packages/astro/src/core/config/schema.ts
index bff55b392..897ebabf6 100644
--- a/packages/astro/src/core/config/schema.ts
+++ b/packages/astro/src/core/config/schema.ts
@@ -25,7 +25,7 @@ const ASTRO_CONFIG_DEFAULTS = {
assets: '_astro',
serverEntry: 'entry.mjs',
redirects: true,
- inlineStylesheets: 'never',
+ inlineStylesheets: 'auto',
split: false,
excludeMiddleware: false,
},
diff --git a/packages/astro/test/alias-tsconfig-baseurl-only.test.js b/packages/astro/test/alias-tsconfig-baseurl-only.test.js
index 55b7ecc37..64c196808 100644
--- a/packages/astro/test/alias-tsconfig-baseurl-only.test.js
+++ b/packages/astro/test/alias-tsconfig-baseurl-only.test.js
@@ -29,6 +29,8 @@ describe('Aliases with tsconfig.json - baseUrl only', () => {
before(async () => {
fixture = await loadFixture({
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
root: './fixtures/alias-tsconfig-baseurl-only/',
});
});
diff --git a/packages/astro/test/alias-tsconfig.test.js b/packages/astro/test/alias-tsconfig.test.js
index 4668ea66e..283a66ea1 100644
--- a/packages/astro/test/alias-tsconfig.test.js
+++ b/packages/astro/test/alias-tsconfig.test.js
@@ -29,6 +29,8 @@ describe('Aliases with tsconfig.json', () => {
before(async () => {
fixture = await loadFixture({
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
root: './fixtures/alias-tsconfig/',
});
});
diff --git a/packages/astro/test/asset-url-base.test.js b/packages/astro/test/asset-url-base.test.js
index 0dc565b7f..de63ef4b7 100644
--- a/packages/astro/test/asset-url-base.test.js
+++ b/packages/astro/test/asset-url-base.test.js
@@ -12,6 +12,8 @@ describe('Asset URL resolution in build', () => {
fixture = await loadFixture({
root: './fixtures/asset-url-base/',
site: 'http://example.com/sub/path/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build();
});
@@ -30,6 +32,8 @@ describe('Asset URL resolution in build', () => {
root: './fixtures/asset-url-base/',
site: 'http://example.com/sub/path/',
base: '/another/base/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build();
});
diff --git a/packages/astro/test/astro-client-only.test.js b/packages/astro/test/astro-client-only.test.js
index c003e0a28..9f6de9116 100644
--- a/packages/astro/test/astro-client-only.test.js
+++ b/packages/astro/test/astro-client-only.test.js
@@ -9,6 +9,8 @@ describe('Client only components', () => {
before(async () => {
fixture = await loadFixture({
root: './fixtures/astro-client-only/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build();
});
@@ -72,6 +74,8 @@ describe('Client only components subpath', () => {
site: 'https://site.com',
base: '/blog',
root: './fixtures/astro-client-only/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build();
});
diff --git a/packages/astro/test/astro-css-bundling.test.js b/packages/astro/test/astro-css-bundling.test.js
index 415c8f398..2da01108f 100644
--- a/packages/astro/test/astro-css-bundling.test.js
+++ b/packages/astro/test/astro-css-bundling.test.js
@@ -26,6 +26,8 @@ describe('CSS Bundling', function () {
before(async () => {
fixture = await loadFixture({
root: './fixtures/astro-css-bundling/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build({ mode: 'production' });
});
@@ -76,6 +78,9 @@ describe('CSS Bundling', function () {
fixture = await loadFixture({
root: './fixtures/astro-css-bundling/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
+
vite: {
build: {
rollupOptions: {
diff --git a/packages/astro/test/astro-directives.test.js b/packages/astro/test/astro-directives.test.js
index 2a86e4ba2..ca01e8ff4 100644
--- a/packages/astro/test/astro-directives.test.js
+++ b/packages/astro/test/astro-directives.test.js
@@ -6,7 +6,11 @@ describe('Directives', async () => {
let fixture;
before(async () => {
- fixture = await loadFixture({ root: './fixtures/astro-directives/' });
+ fixture = await loadFixture({
+ root: './fixtures/astro-directives/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' }
+ });
await fixture.build();
});
diff --git a/packages/astro/test/astro-head.test.js b/packages/astro/test/astro-head.test.js
index 862894d73..ed28500dc 100644
--- a/packages/astro/test/astro-head.test.js
+++ b/packages/astro/test/astro-head.test.js
@@ -10,6 +10,8 @@ describe('Head in its own component', () => {
root: './fixtures/astro-head/',
site: 'https://mysite.dev/',
base: '/blog',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build();
});
diff --git a/packages/astro/test/build-assets.test.js b/packages/astro/test/build-assets.test.js
index 1fa17e8d2..3d4dacd7b 100644
--- a/packages/astro/test/build-assets.test.js
+++ b/packages/astro/test/build-assets.test.js
@@ -13,6 +13,8 @@ describe('build assets (static)', () => {
fixture = await loadFixture({
root: './fixtures/build-assets/',
integrations: [preact()],
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build();
});
@@ -57,6 +59,7 @@ describe('build assets (static)', () => {
integrations: [preact()],
build: {
assets: 'custom-assets',
+ inlineStylesheets: 'never',
},
});
await fixture.build();
@@ -96,6 +99,8 @@ describe('build assets (server)', () => {
root: './fixtures/build-assets/',
integrations: [preact()],
adapter: testAdapter(),
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build();
});
@@ -140,6 +145,7 @@ describe('build assets (server)', () => {
integrations: [preact()],
build: {
assets: 'custom-assets',
+ inlineStylesheets: 'never',
},
adapter: testAdapter(),
});
diff --git a/packages/astro/test/component-library.test.js b/packages/astro/test/component-library.test.js
index 58c7fb6b8..c11f9eed6 100644
--- a/packages/astro/test/component-library.test.js
+++ b/packages/astro/test/component-library.test.js
@@ -13,6 +13,8 @@ describe('Component Libraries', () => {
before(async () => {
fixture = await loadFixture({
root: './fixtures/component-library/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
});
diff --git a/packages/astro/test/config-vite-css-target.test.js b/packages/astro/test/config-vite-css-target.test.js
index cb9fa8de2..94fa74e74 100644
--- a/packages/astro/test/config-vite-css-target.test.js
+++ b/packages/astro/test/config-vite-css-target.test.js
@@ -10,7 +10,11 @@ let fixture;
describe('CSS', function () {
before(async () => {
- fixture = await loadFixture({ root: './fixtures/config-vite-css-target/' });
+ fixture = await loadFixture({
+ root: './fixtures/config-vite-css-target/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
+ });
});
describe('build', () => {
diff --git a/packages/astro/test/config-vite.test.js b/packages/astro/test/config-vite.test.js
index f910bc30b..b15729dd7 100644
--- a/packages/astro/test/config-vite.test.js
+++ b/packages/astro/test/config-vite.test.js
@@ -6,7 +6,11 @@ describe('Vite Config', async () => {
let fixture;
before(async () => {
- fixture = await loadFixture({ root: './fixtures/config-vite/' });
+ fixture = await loadFixture({
+ root: './fixtures/config-vite/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
+ });
await fixture.build();
});
diff --git a/packages/astro/test/content-collections-render.test.js b/packages/astro/test/content-collections-render.test.js
index f6a9c3c72..27eb33b5a 100644
--- a/packages/astro/test/content-collections-render.test.js
+++ b/packages/astro/test/content-collections-render.test.js
@@ -13,6 +13,8 @@ describe('Content Collections - render()', () => {
before(async () => {
fixture = await loadFixture({
root: './fixtures/content/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build();
});
@@ -106,6 +108,8 @@ describe('Content Collections - render()', () => {
output: 'server',
root: './fixtures/content/',
adapter: testAdapter(),
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build();
});
diff --git a/packages/astro/test/css-import-as-inline.test.js b/packages/astro/test/css-import-as-inline.test.js
index 7dacab377..dcff4f32b 100644
--- a/packages/astro/test/css-import-as-inline.test.js
+++ b/packages/astro/test/css-import-as-inline.test.js
@@ -7,6 +7,8 @@ describe('Importing raw/inlined CSS', () => {
before(async () => {
fixture = await loadFixture({
root: './fixtures/css-import-as-inline/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
});
describe('Build', () => {
diff --git a/packages/astro/test/css-no-code-split.test.js b/packages/astro/test/css-no-code-split.test.js
index 7fcf7efc2..fc91c60f7 100644
--- a/packages/astro/test/css-no-code-split.test.js
+++ b/packages/astro/test/css-no-code-split.test.js
@@ -7,7 +7,11 @@ describe('vite.build.cssCodeSplit: false', () => {
let fixture;
before(async () => {
- fixture = await loadFixture({ root: './fixtures/css-no-code-split/' });
+ fixture = await loadFixture({
+ root: './fixtures/css-no-code-split/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
+ });
await fixture.build();
});
diff --git a/packages/astro/test/css-order-import.test.js b/packages/astro/test/css-order-import.test.js
index 745187c53..9a5cf6933 100644
--- a/packages/astro/test/css-order-import.test.js
+++ b/packages/astro/test/css-order-import.test.js
@@ -8,6 +8,8 @@ describe('CSS ordering - import order', () => {
before(async () => {
fixture = await loadFixture({
root: './fixtures/css-order-import/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
});
@@ -133,6 +135,8 @@ describe('CSS ordering - import order', () => {
before(async () => {
fixture = await loadFixture({
root: './fixtures/css-order-dynamic-import/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build();
});
diff --git a/packages/astro/test/css-order-layout.test.js b/packages/astro/test/css-order-layout.test.js
index 948f7975b..991246faf 100644
--- a/packages/astro/test/css-order-layout.test.js
+++ b/packages/astro/test/css-order-layout.test.js
@@ -8,6 +8,8 @@ describe('CSS ordering - import order with layouts', () => {
before(async () => {
fixture = await loadFixture({
root: './fixtures/css-order-layout/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
});
diff --git a/packages/astro/test/css-order.test.js b/packages/astro/test/css-order.test.js
index e3333b875..73b147212 100644
--- a/packages/astro/test/css-order.test.js
+++ b/packages/astro/test/css-order.test.js
@@ -75,6 +75,8 @@ describe('CSS production ordering', () => {
before(async () => {
fixture = await loadFixture({
root: './fixtures/css-order/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build();
});
diff --git a/packages/astro/test/glob-pages-css.test.js b/packages/astro/test/glob-pages-css.test.js
index 72558490f..3c2bb5454 100644
--- a/packages/astro/test/glob-pages-css.test.js
+++ b/packages/astro/test/glob-pages-css.test.js
@@ -8,6 +8,8 @@ describe('Astro.glob on pages/ directory', () => {
before(async () => {
fixture = await loadFixture({
root: './fixtures/glob-pages-css/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build();
});
diff --git a/packages/astro/test/head-injection.test.js b/packages/astro/test/head-injection.test.js
index a2c0389df..139c97005 100644
--- a/packages/astro/test/head-injection.test.js
+++ b/packages/astro/test/head-injection.test.js
@@ -9,6 +9,8 @@ describe('Head injection', () => {
before(async () => {
fixture = await loadFixture({
root: './fixtures/head-injection/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
});
diff --git a/packages/astro/test/lazy-layout.test.js b/packages/astro/test/lazy-layout.test.js
index 4ed22f5a0..8f50a91dc 100644
--- a/packages/astro/test/lazy-layout.test.js
+++ b/packages/astro/test/lazy-layout.test.js
@@ -7,7 +7,11 @@ describe('Lazily imported layouts', () => {
let fixture;
before(async () => {
- fixture = await loadFixture({ root: './fixtures/lazy-layout/' });
+ fixture = await loadFixture({
+ root: './fixtures/lazy-layout/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
+ });
await fixture.build();
});
diff --git a/packages/astro/test/minification-html.test.js b/packages/astro/test/minification-html.test.js
index bd86e233b..cd3e70a1d 100644
--- a/packages/astro/test/minification-html.test.js
+++ b/packages/astro/test/minification-html.test.js
@@ -47,7 +47,11 @@ describe('HTML minification', () => {
describe('Build SSG', () => {
let fixture;
before(async () => {
- fixture = await loadFixture({ root: './fixtures/minification-html/' });
+ fixture = await loadFixture({
+ root: './fixtures/minification-html/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
+ });
await fixture.build();
});
@@ -64,6 +68,8 @@ describe('HTML minification', () => {
root: './fixtures/minification-html/',
output: 'server',
adapter: testAdapter(),
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build();
});
diff --git a/packages/astro/test/page-level-styles.test.js b/packages/astro/test/page-level-styles.test.js
index 3fdce62b9..541a4b6eb 100644
--- a/packages/astro/test/page-level-styles.test.js
+++ b/packages/astro/test/page-level-styles.test.js
@@ -9,6 +9,8 @@ describe('Page-level styles', () => {
before(async () => {
fixture = await loadFixture({
root: './fixtures/page-level-styles/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build();
});
diff --git a/packages/astro/test/postcss.test.js b/packages/astro/test/postcss.test.js
index 126fca95c..0fcc60409 100644
--- a/packages/astro/test/postcss.test.js
+++ b/packages/astro/test/postcss.test.js
@@ -10,6 +10,8 @@ describe('PostCSS', function () {
this.timeout(45000); // test needs a little more time in CI
fixture = await loadFixture({
root: './fixtures/postcss',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build();
diff --git a/packages/astro/test/remote-css.test.js b/packages/astro/test/remote-css.test.js
index 4ca6eb422..4f9a25e35 100644
--- a/packages/astro/test/remote-css.test.js
+++ b/packages/astro/test/remote-css.test.js
@@ -8,6 +8,8 @@ describe('Remote CSS', () => {
before(async () => {
fixture = await loadFixture({
root: './fixtures/remote-css/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build();
});
diff --git a/packages/astro/test/root-srcdir-css.test.js b/packages/astro/test/root-srcdir-css.test.js
index 3902b4ab2..e033ff35b 100644
--- a/packages/astro/test/root-srcdir-css.test.js
+++ b/packages/astro/test/root-srcdir-css.test.js
@@ -8,6 +8,8 @@ describe('srcDir', () => {
before(async () => {
fixture = await loadFixture({
root: './fixtures/root-srcdir-css/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build();
});
diff --git a/packages/astro/test/scoped-style-strategy.test.js b/packages/astro/test/scoped-style-strategy.test.js
index a59f227ad..7781badf7 100644
--- a/packages/astro/test/scoped-style-strategy.test.js
+++ b/packages/astro/test/scoped-style-strategy.test.js
@@ -12,6 +12,8 @@ describe('scopedStyleStrategy', () => {
fixture = await loadFixture({
root: './fixtures/scoped-style-strategy/',
scopedStyleStrategy: 'where',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build();
@@ -40,6 +42,8 @@ describe('scopedStyleStrategy', () => {
fixture = await loadFixture({
root: './fixtures/scoped-style-strategy/',
scopedStyleStrategy: 'class',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build();
@@ -67,6 +71,8 @@ describe('scopedStyleStrategy', () => {
before(async () => {
fixture = await loadFixture({
root: './fixtures/scoped-style-strategy/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build();
diff --git a/packages/astro/test/ssr-404-500-pages.test.js b/packages/astro/test/ssr-404-500-pages.test.js
index ac747a16c..253f9bc1c 100644
--- a/packages/astro/test/ssr-404-500-pages.test.js
+++ b/packages/astro/test/ssr-404-500-pages.test.js
@@ -12,6 +12,8 @@ describe('404 and 500 pages', () => {
root: './fixtures/ssr-api-route-custom-404/',
output: 'server',
adapter: testAdapter(),
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
});
diff --git a/packages/astro/test/ssr-assets.test.js b/packages/astro/test/ssr-assets.test.js
index e02045bc0..01015f087 100644
--- a/packages/astro/test/ssr-assets.test.js
+++ b/packages/astro/test/ssr-assets.test.js
@@ -11,6 +11,8 @@ describe('SSR Assets', () => {
root: './fixtures/ssr-assets/',
output: 'server',
adapter: testAdapter(),
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build();
});
diff --git a/packages/astro/test/ssr-dynamic.test.js b/packages/astro/test/ssr-dynamic.test.js
index e4bb61b4a..62e67e410 100644
--- a/packages/astro/test/ssr-dynamic.test.js
+++ b/packages/astro/test/ssr-dynamic.test.js
@@ -25,6 +25,8 @@ describe('Dynamic pages in SSR', () => {
},
],
adapter: testAdapter(),
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build();
});
diff --git a/packages/astro/test/ssr-manifest.test.js b/packages/astro/test/ssr-manifest.test.js
index bd9483505..b45d6b581 100644
--- a/packages/astro/test/ssr-manifest.test.js
+++ b/packages/astro/test/ssr-manifest.test.js
@@ -12,6 +12,8 @@ describe('astro:ssr-manifest', () => {
root: './fixtures/ssr-manifest/',
output: 'server',
adapter: testAdapter(),
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build();
});
diff --git a/packages/astro/test/ssr-split-manifest.test.js b/packages/astro/test/ssr-split-manifest.test.js
index d7c1f32c5..38a3233ee 100644
--- a/packages/astro/test/ssr-split-manifest.test.js
+++ b/packages/astro/test/ssr-split-manifest.test.js
@@ -26,6 +26,8 @@ describe('astro:ssr-manifest, split', () => {
currentRoutes = routes;
},
}),
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build();
});
diff --git a/packages/astro/test/static-build.test.js b/packages/astro/test/static-build.test.js
index 0552c353f..77c24f398 100644
--- a/packages/astro/test/static-build.test.js
+++ b/packages/astro/test/static-build.test.js
@@ -34,6 +34,8 @@ describe('Static build', () => {
fixture = await loadFixture({
root: './fixtures/static-build/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
await fixture.build({ logging });
});
diff --git a/packages/astro/test/virtual-astro-file.test.js b/packages/astro/test/virtual-astro-file.test.js
index e5247a684..470169f13 100644
--- a/packages/astro/test/virtual-astro-file.test.js
+++ b/packages/astro/test/virtual-astro-file.test.js
@@ -6,7 +6,11 @@ describe('Loading virtual Astro files', () => {
let fixture;
before(async () => {
- fixture = await loadFixture({ root: './fixtures/virtual-astro-file/' });
+ fixture = await loadFixture({
+ root: './fixtures/virtual-astro-file/',
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
+ });
await fixture.build();
});
diff --git a/packages/integrations/deno/test/basics.test.ts b/packages/integrations/deno/test/basics.test.ts
index cdb0c616e..30bca0eb3 100644
--- a/packages/integrations/deno/test/basics.test.ts
+++ b/packages/integrations/deno/test/basics.test.ts
@@ -48,14 +48,11 @@ Deno.test({
const html = await resp.text();
const doc = new DOMParser().parseFromString(html, `text/html`);
- const link = doc!.querySelector('link');
- const href = link!.getAttribute('href');
+ const style = doc!.querySelector('style');
- resp = await fetch(new URL(href!, app.url));
- assertEquals(resp.status, 200);
- const ct = resp.headers.get('content-type');
- assertEquals(ct, 'text/css; charset=UTF-8');
- await resp.body!.cancel();
+ assertEquals(style?.getAttribute('type'), 'text/css');
+
+ assert(style?.textContent?.includes('Courier New'))
});
await t.step('Correctly loads run-time env variables', async () => {
diff --git a/packages/integrations/markdoc/test/propagated-assets.test.js b/packages/integrations/markdoc/test/propagated-assets.test.js
index 429e07141..4326233c1 100644
--- a/packages/integrations/markdoc/test/propagated-assets.test.js
+++ b/packages/integrations/markdoc/test/propagated-assets.test.js
@@ -8,6 +8,8 @@ describe('Markdoc - propagated assets', () => {
before(async () => {
fixture = await loadFixture({
root: new URL('./fixtures/propagated-assets/', import.meta.url),
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
});
diff --git a/packages/integrations/mdx/test/css-head-mdx.test.js b/packages/integrations/mdx/test/css-head-mdx.test.js
index f4ece38d9..ed1c6d1d6 100644
--- a/packages/integrations/mdx/test/css-head-mdx.test.js
+++ b/packages/integrations/mdx/test/css-head-mdx.test.js
@@ -12,6 +12,8 @@ describe('Head injection w/ MDX', () => {
fixture = await loadFixture({
root: new URL('./fixtures/css-head-mdx/', import.meta.url),
integrations: [mdx()],
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
});
diff --git a/packages/integrations/mdx/test/mdx-page.test.js b/packages/integrations/mdx/test/mdx-page.test.js
index 52d10bce3..752987012 100644
--- a/packages/integrations/mdx/test/mdx-page.test.js
+++ b/packages/integrations/mdx/test/mdx-page.test.js
@@ -8,6 +8,8 @@ describe('MDX Page', () => {
before(async () => {
fixture = await loadFixture({
root: new URL('./fixtures/mdx-page/', import.meta.url),
+ // test suite was authored when inlineStylesheets defaulted to never
+ build: { inlineStylesheets: 'never' },
});
});
diff --git a/packages/integrations/node/test/prerender-404-500.test.js b/packages/integrations/node/test/prerender-404-500.test.js
index 8816ebe4c..ea1b762a7 100644
--- a/packages/integrations/node/test/prerender-404-500.test.js
+++ b/packages/integrations/node/test/prerender-404-500.test.js
@@ -101,7 +101,7 @@ describe('Prerender 404', () => {
const $ = cheerio.load(html);
// length will be 0 if the stylesheet does not get included
- expect($('link[rel=stylesheet]')).to.have.a.lengthOf(1);
+ expect($('style[type="text/css"]')).to.have.a.lengthOf(1);
});
});