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:
parent
6fa89e84c9
commit
4161a2a3d0
2 changed files with 8 additions and 3 deletions
5
.changeset/fluffy-zoos-hammer.md
Normal file
5
.changeset/fluffy-zoos-hammer.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"astro": patch
|
||||
---
|
||||
|
||||
fix incorrect actions path on windows
|
|
@ -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: {
|
||||
|
|
Loading…
Reference in a new issue