mirror of
https://github.com/withastro/astro.git
synced 2025-01-27 22:19:04 -05:00
fix: content types reference to config on windows (#9877)
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
This commit is contained in:
parent
38e40f1cc2
commit
7be5f94dcf
2 changed files with 8 additions and 1 deletions
5
.changeset/funny-mice-help.md
Normal file
5
.changeset/funny-mice-help.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"astro": patch
|
||||
---
|
||||
|
||||
Fixes the content config type path on windows
|
|
@ -345,8 +345,10 @@ function invalidateVirtualMod(viteServer: ViteDevServer) {
|
|||
*/
|
||||
function normalizeConfigPath(from: string, to: string) {
|
||||
const configPath = path.relative(from, to).replace(/\.ts$/, '.js');
|
||||
// on windows `path.relative` will use backslashes, these must be replaced with forward slashes
|
||||
const normalizedPath = configPath.replaceAll('\\', '/');
|
||||
|
||||
return `"${isRelativePath(configPath) ? '' : './'}${configPath}"` as const;
|
||||
return `"${isRelativePath(configPath) ? '' : './'}${normalizedPath}"` as const;
|
||||
}
|
||||
|
||||
async function writeContentFiles({
|
||||
|
|
Loading…
Add table
Reference in a new issue