Make aliases work on windows (#2109)
* Make aliases work on windows Change all occurrences of path.posix to path. * Remove console log statement * Update index.ts * Update index.ts * Update index.ts * Edit changeset
This commit is contained in:
parent
213a2622e2
commit
3e4cfea4e2
2 changed files with 6 additions and 1 deletions
5
.changeset/chilled-coins-wash.md
Normal file
5
.changeset/chilled-coins-wash.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'astro': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fixes aliases on windows.
|
|
@ -35,7 +35,7 @@ const getConfigAlias = (cwd: string | undefined): Alias[] | null => {
|
||||||
if (!compilerOptions.baseUrl) return null;
|
if (!compilerOptions.baseUrl) return null;
|
||||||
|
|
||||||
// resolve the base url from the configuration file directory
|
// resolve the base url from the configuration file directory
|
||||||
const baseUrl = path.posix.resolve(path.posix.dirname(normalize(config.path)), normalize(compilerOptions.baseUrl));
|
const baseUrl = path.posix.resolve(path.posix.dirname(normalize(config.path).replace(/^\/?/, '/')), normalize(compilerOptions.baseUrl));
|
||||||
|
|
||||||
/** List of compiled alias expressions. */
|
/** List of compiled alias expressions. */
|
||||||
const aliases: Alias[] = [];
|
const aliases: Alias[] = [];
|
||||||
|
|
Loading…
Reference in a new issue