summaryrefslogtreecommitdiff
path: root/src/runtime.ts
diff options
context:
space:
mode:
authorGravatar Drew Powers <1369770+drwpow@users.noreply.github.com> 2021-04-14 13:21:25 -0600
committerGravatar GitHub <noreply@github.com> 2021-04-14 13:21:25 -0600
commit034674c88c5eab59d1cf8883951daa60693fb95c (patch)
tree603f2e7e6e1e825f303c36ca1b72cccd3caba43d /src/runtime.ts
parentec75312a153424a47e05d72d41f4c3152cc7ad09 (diff)
downloadastro-034674c88c5eab59d1cf8883951daa60693fb95c.tar.gz
astro-034674c88c5eab59d1cf8883951daa60693fb95c.tar.zst
astro-034674c88c5eab59d1cf8883951daa60693fb95c.zip
Add Windows Support (#93)
* Add Windows to test suite * Try implicit URL
Diffstat (limited to '')
-rw-r--r--src/runtime.ts11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/runtime.ts b/src/runtime.ts
index 583fb97b5..24e186e1c 100644
--- a/src/runtime.ts
+++ b/src/runtime.ts
@@ -1,3 +1,4 @@
+import { fileURLToPath } from 'url';
import type { SnowpackDevServer, ServerRuntime as SnowpackServerRuntime, SnowpackConfig } from 'snowpack';
import type { AstroConfig, CollectionResult, CreateCollection, Params, RuntimeMode } from './@types/astro';
import type { LogOptions } from './logger';
@@ -223,19 +224,19 @@ async function createSnowpack(astroConfig: AstroConfig, env: Record<string, any>
};
const mountOptions = {
- [astroRoot.pathname]: '/_astro',
- [internalPath.pathname]: '/_astro_internal',
+ [fileURLToPath(astroRoot)]: '/_astro',
+ [fileURLToPath(internalPath)]: '/_astro_internal',
};
if (existsSync(astroConfig.public)) {
- mountOptions[astroConfig.public.pathname] = '/';
+ mountOptions[fileURLToPath(astroConfig.public)] = '/';
}
const snowpackConfig = await loadConfiguration({
- root: projectRoot.pathname,
+ root: fileURLToPath(projectRoot),
mount: mountOptions,
plugins: [
- [new URL('../snowpack-plugin.cjs', import.meta.url).pathname, astroPlugOptions],
+ [fileURLToPath(new URL('../snowpack-plugin.cjs', import.meta.url)), astroPlugOptions],
require.resolve('@snowpack/plugin-sass'),
require.resolve('@snowpack/plugin-svelte'),
require.resolve('@snowpack/plugin-vue'),