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

Sign up
Appearance settings

Commit 8d029e7

Browse files
Fixed a path bug preventing themes from working on Windows (#1664)
1 parent 0037954 commit 8d029e7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎src/output/html.js‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@ import mergeConfig from '../merge_config.js';
1818
*/
1919
export default async function html(comments, localConfig = {}) {
2020
const config = await mergeConfig(localConfig);
21-
const themePath = config.theme && path.resolve(process.cwd(), config.theme);
21+
let themePath = config.theme && path.resolve(process.cwd(), config.theme);
2222
if (themePath) {
23+
if (process.platform === 'win32'){
24+
// On Windows, absolute paths must be prefixed with 'file:///' to avoid the ERR_UNSUPPORTED_ESM_URL_SCHEME error from import().
25+
themePath = 'file:///' + themePath;
26+
}
27+
2328
return (await import(themePath)).default(comments, config);
2429
}
25-
2630
return (await import('../default_theme/index.js')).default(comments, config);
2731
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /