diff --git a/.changeset/fluffy-zoos-hammer.md b/.changeset/fluffy-zoos-hammer.md new file mode 100644 index 000000000000..210f3c327f72 --- /dev/null +++ b/.changeset/fluffy-zoos-hammer.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +fix incorrect actions path on windows diff --git a/packages/astro/src/actions/index.ts b/packages/astro/src/actions/index.ts index 56f5f661d330..1c3a555139d7 100644 --- a/packages/astro/src/actions/index.ts +++ b/packages/astro/src/actions/index.ts @@ -2,15 +2,15 @@ import { mkdir, readFile, writeFile } from 'node:fs/promises'; import type { Plugin as VitePlugin } from 'vite'; import type { AstroIntegration } from '../@types/astro.js'; import { ACTIONS_TYPES_FILE, RESOLVED_VIRTUAL_MODULE_ID, VIRTUAL_MODULE_ID } from './consts.js'; +import { viteID } from '../core/util.js'; + export default function astroActions(): AstroIntegration { return { name: VIRTUAL_MODULE_ID, hooks: { async 'astro:config:setup'(params) { - const stringifiedActionsImport = JSON.stringify( - new URL('actions', params.config.srcDir).pathname - ); + const stringifiedActionsImport = JSON.stringify(viteID(new URL('./actions', params.config.srcDir))); params.updateConfig({ vite: { define: {