8000 fix: avoid using file urls for normalized paths in options · nitrojs/nitro@7517293 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7517293

Browse files
committed
fix: avoid using file urls for normalized paths in options
#836
1 parent ed3a480 commit 7517293

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

src/options.ts

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { pathToFileURL } from "node:url";
2-
import { resolve, join, isAbsolute } from "pathe";
1+
import { resolve, join, normalize } from "pathe";
32
import { loadConfig } from "c12";
43
import { klona } from "klona/full";
54
import { camelCase } from "scule";
@@ -218,16 +217,6 @@ export async function loadOptions(
218217
);
219218
}
220219

221-
// Normalise absolute auto-import paths for windows machines
222-
if (options.imports && options.dev) {
223-
options.imports.imports = options.imports.imports || [];
224-
for (const entry of options.imports.imports) {
225-
if (isAbsolute(entry.from)) {
226-
entry.from = pathToFileURL(entry.from).href;
227-
}
228-
}
229-
}
230-
231220
// Add h3 auto imports preset
232221
if (options.imports) {
233222
const h3Exports = await resolveModuleExportNames("h3", {
@@ -329,13 +318,7 @@ export async function loadOptions(
329318
}
330319

331320
// Resolve plugin paths
332-
options.plugins = options.plugins.map((p) => {
333-
const path = resolvePath(p, options);
334-
if (options.dev && isAbsolute(path)) {
335-
return pathToFileURL(path).href;
336-
}
337-
return path;
338-
});
321+
options.plugins = options.plugins.map((p) => resolvePath(p, options));
339322

340323
return options;
341324
}

0 commit comments

Comments
 (0)
0