0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

fix: fix incorrect actions path on windows (#10990)

* fix:  remove actions path leading slash on windows

* add changeset

* use `viteID` get actions path

* update changeset
This commit is contained in:
liruifengv 2024-05-10 01:38:42 +08:00 committed by GitHub
parent 6fa89e84c9
commit 4161a2a3d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View file

@ -0,0 +1,5 @@
---
"astro": patch
---
fix incorrect actions path on windows

View file

@ -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: {