summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/astro/src/core/build/pipeline.ts2
-rw-r--r--packages/astro/src/core/build/plugins/util.ts8
-rw-r--r--packages/astro/test/ssr-dynamic.test.js8
3 files changed, 10 insertions, 8 deletions
diff --git a/packages/astro/src/core/build/pipeline.ts b/packages/astro/src/core/build/pipeline.ts
index 68cee31a7..a89aa10f0 100644
--- a/packages/astro/src/core/build/pipeline.ts
+++ b/packages/astro/src/core/build/pipeline.ts
@@ -16,8 +16,8 @@ import {
mergeInlineCss,
} from './internal.js';
import { ASTRO_PAGE_MODULE_ID, ASTRO_PAGE_RESOLVED_MODULE_ID } from './plugins/plugin-pages.js';
-import { getVirtualModulePageNameFromPath } from './plugins/util.js';
import { RESOLVED_SPLIT_MODULE_ID } from './plugins/plugin-ssr.js';
+import { getVirtualModulePageNameFromPath } from './plugins/util.js';
import { ASTRO_PAGE_EXTENSION_POST_PATTERN } from './plugins/util.js';
import type { PageBuildData, StaticBuildOptions } from './types.js';
import { i18nHasFallback } from './util.js';
diff --git a/packages/astro/src/core/build/plugins/util.ts b/packages/astro/src/core/build/plugins/util.ts
index e205f75eb..0c9636b30 100644
--- a/packages/astro/src/core/build/plugins/util.ts
+++ b/packages/astro/src/core/build/plugins/util.ts
@@ -45,7 +45,7 @@ export const ASTRO_PAGE_EXTENSION_POST_PATTERN = '@_@';
/**
* Prevents Rollup from triggering other plugins in the process by masking the extension (hence the virtual file).
- *
+ *
* 1. We add a fixed prefix, which is used as virtual module naming convention
* 2. If the path has an extension (at the end of the path), we replace the dot that belongs to the extension with an arbitrary string.
*
@@ -54,10 +54,12 @@ export const ASTRO_PAGE_EXTENSION_POST_PATTERN = '@_@';
*/
export function getVirtualModulePageNameFromPath(virtualModulePrefix: string, path: string) {
const extension = extname(path);
- return virtualModulePrefix +
+ return (
+ virtualModulePrefix +
(extension.startsWith('.')
? path.slice(0, -extension.length) + extension.replace('.', ASTRO_PAGE_EXTENSION_POST_PATTERN)
- : path);
+ : path)
+ );
}
/**
diff --git a/packages/astro/test/ssr-dynamic.test.js b/packages/astro/test/ssr-dynamic.test.js
index 6016f5fbd..4cf0bcd5a 100644
--- a/packages/astro/test/ssr-dynamic.test.js
+++ b/packages/astro/test/ssr-dynamic.test.js
@@ -1,11 +1,11 @@
import assert from 'node:assert/strict';
+import { mkdirSync, writeFileSync } from 'node:fs';
+import { dirname } from 'node:path';
import { before, describe, it } from 'node:test';
+import { fileURLToPath } from 'node:url';
import { load as cheerioLoad } from 'cheerio';
import testAdapter from './test-adapter.js';
import { loadFixture } from './test-utils.js';
-import { dirname } from 'node:path';
-import { fileURLToPath } from 'node:url';
-import { mkdirSync, writeFileSync } from 'node:fs';
describe('Dynamic pages in SSR', () => {
/** @type {import('./test-utils').Fixture} */
@@ -29,7 +29,7 @@ describe('Dynamic pages in SSR', () => {
const entrypoint = fileURLToPath(
new URL(`${root}.astro/test.astro`, import.meta.url)
);
- console.log(entrypoint)
+ console.log(entrypoint);
mkdirSync(dirname(entrypoint), { recursive: true });
writeFileSync(entrypoint, '<h1>Index</h1>');
r>2023-02-14don't break esbuildGravatar Jarred Sumner 7-75/+50 2023-02-14Add workaround for `tls` and `worker_threads`Gravatar Jarred Sumner 3-1/+64 2023-02-14[install] improve `package.json` validation (#2074)Gravatar Alex Lam S.L 6-104/+342 2023-02-14[WIP] fix(node:fs): export `fs.ReadStream` and `fs.WriteStream` (#1798)Gravatar Derrick Farris 4-72/+326 2023-02-14Reject with error when invalid fetch() body (#2047)Gravatar Eric Zhang 2-12/+44 2023-02-13fix(FormData): make String explicit, thanks @dylan-conway (#2065)Gravatar Derrick Farris 1-1/+1 2023-02-13fix(FormData): add string literal operator (#2064)Gravatar Derrick Farris 1-2/+2 2023-02-13Add pretty printer for FormDataGravatar Jarred Sumner 5-1/+101 2023-02-13Add dynamic port assigning to Bun.serve (#2062)Gravatar MichaƂ Warda 3-5/+40 2023-02-13feat(napi): add `napi_get_value_bigint_words` (#2061)Gravatar Derrick Farris 3-0/+44 2023-02-13Fixes https://github.com/oven-sh/bun/issues/1456Gravatar Jarred Sumner 8-1/+148