diff --git a/packages/astro/src/core/build/static-build.ts b/packages/astro/src/core/build/static-build.ts index b99890b829bb..1ef57d787d18 100644 --- a/packages/astro/src/core/build/static-build.ts +++ b/packages/astro/src/core/build/static-build.ts @@ -385,15 +385,14 @@ async function ssrMoveAssets(opts: StaticBuildOptions) { }); if (files.length > 0) { - await Promise.all( files.map(async (filename) => { const currentUrl = new URL(filename, appendForwardSlash(serverAssets.toString())); const clientUrl = new URL(filename, appendForwardSlash(clientAssets.toString())); - const dir = new URL(path.parse(clientUrl.href).dir) - // It can't find this file because the user defines a custom path + const dir = new URL(path.parse(clientUrl.href).dir); + // It can't find this file because the user defines a custom path // that includes the folder paths in `assetFileNames - if(!fs.existsSync(dir)) await fs.promises.mkdir(dir, { recursive: true }); + if (!fs.existsSync(dir)) await fs.promises.mkdir(dir, { recursive: true }); return fs.promises.rename(currentUrl, clientUrl); }) ); diff --git a/packages/astro/test/custom-assets-name.test.js b/packages/astro/test/custom-assets-name.test.js index 345a9d2a7eee..c44116921075 100644 --- a/packages/astro/test/custom-assets-name.test.js +++ b/packages/astro/test/custom-assets-name.test.js @@ -14,7 +14,7 @@ describe('custom the assets name function', () => { }); it('It cant find this file cause the node throws an error if the users custom a path that includes the folder path', async () => { - const csslength = await fixture.readFile('client/assets/css/a.css') + const csslength = await fixture.readFile('client/assets/css/a.css'); /** @type {Set} */ expect(!!csslength).to.equal(true); });