Skip to content

Commit

Permalink
fix: fix incorrect actions path on windows (#10990)
Browse files Browse the repository at this point in the history
* fix:  remove actions path leading slash on windows

* add changeset

* use `viteID` get actions path

* update changeset
  • Loading branch information
liruifengv committed May 9, 2024
1 parent 6fa89e8 commit 4161a2a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/fluffy-zoos-hammer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"astro": patch
---

fix incorrect actions path on windows
6 changes: 3 additions & 3 deletions packages/astro/src/actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 4161a2a

Please sign in to comment.