File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed
docs-svelte-kit/build-system Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 1
1
import esbuild from "esbuild"
2
2
import path from "path"
3
3
import fs from "fs"
4
+ import { fileURLToPath } from "url"
4
5
// const babelCore = require("@babel/core")
5
6
// const t = require("@babel/types")
6
7
7
8
const dirname = path . dirname (
8
- new URL (
9
+ fileURLToPath (
9
10
// @ts -expect-error -- Cannot change `module` option
10
11
import . meta. url ,
11
- ) . pathname ,
12
+ ) ,
12
13
)
13
14
14
15
build (
Original file line number Diff line number Diff line change 1
1
import ghpagesAdapter from "svelte-adapter-ghpages"
2
2
import path from "path"
3
3
import fs from "fs"
4
+ import { fileURLToPath } from "url"
4
5
5
6
// eslint-disable-next-line no-undef -- There seems to be a package that uses `self`.
6
7
if ( typeof self === "undefined" ) {
7
8
globalThis . self = globalThis
8
9
}
9
10
10
- const dirname = path . dirname ( new URL ( import . meta. url ) . pathname )
11
+ const dirname = path . dirname ( fileURLToPath ( import . meta. url ) )
11
12
12
13
// This project can't be ESM yet, so hack it to get svelte-kit to work.
13
14
// A hack that treats files in the `.svelte-kit` directory as ESM.
Original file line number Diff line number Diff line change @@ -6,12 +6,13 @@ import svelteMdOption from "./docs-svelte-kit/tools/vite-plugin-svelte-md-option
6
6
7
7
import "./docs-svelte-kit/build-system/build.mts"
8
8
import type { UserConfig } from "vite"
9
+ import { fileURLToPath } from "url"
9
10
10
11
const dirname = path . dirname (
11
- new URL (
12
+ fileURLToPath (
12
13
// @ts -expect-error -- Cannot change `module` option
13
14
import . meta. url ,
14
- ) . pathname ,
15
+ ) ,
15
16
)
16
17
17
18
/** @type {import('vite').UserConfig } */
You can’t perform that action at this time.
0 commit comments