Fix for allowing space in folder name (#2797)
* Fix for allowing space in folder name * Adds a changeset * Prepend a forward slash, for windows
This commit is contained in:
parent
1325fe90fc
commit
58d8686e94
2 changed files with 8 additions and 1 deletions
5
.changeset/grumpy-dancers-smell.md
Normal file
5
.changeset/grumpy-dancers-smell.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'astro': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix for projects with a folder name containing a space
|
|
@ -7,6 +7,8 @@ import fs from 'fs';
|
||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
import { transform } from '@astrojs/compiler';
|
import { transform } from '@astrojs/compiler';
|
||||||
import { transformWithVite } from './styles.js';
|
import { transformWithVite } from './styles.js';
|
||||||
|
import { viteID } from '../core/util.js';
|
||||||
|
import { prependForwardSlash } from '../core/path.js';
|
||||||
|
|
||||||
type CompilationCache = Map<string, CompileResult>;
|
type CompilationCache = Map<string, CompileResult>;
|
||||||
type CompileResult = TransformResult & { rawCSSDeps: Set<string> };
|
type CompileResult = TransformResult & { rawCSSDeps: Set<string> };
|
||||||
|
@ -49,7 +51,7 @@ async function compile(config: AstroConfig, filename: string, source: string, vi
|
||||||
site: config.buildOptions.site,
|
site: config.buildOptions.site,
|
||||||
sourcefile: filename,
|
sourcefile: filename,
|
||||||
sourcemap: 'both',
|
sourcemap: 'both',
|
||||||
internalURL: `/@fs${new URL('../runtime/server/index.js', import.meta.url).pathname}`,
|
internalURL: `/@fs${prependForwardSlash(viteID(new URL('../runtime/server/index.js', import.meta.url)))}`,
|
||||||
experimentalStaticExtraction: !config.buildOptions.legacyBuild,
|
experimentalStaticExtraction: !config.buildOptions.legacyBuild,
|
||||||
// TODO add experimental flag here
|
// TODO add experimental flag here
|
||||||
preprocessStyle: async (value: string, attrs: Record<string, string>) => {
|
preprocessStyle: async (value: string, attrs: Record<string, string>) => {
|
||||||
|
|
Loading…
Reference in a new issue