Movatterモバイル変換


[0]ホーム

URL:


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

Commit8d029e7

Browse files
authored
Fixed a path bug preventing themes from working on Windows (#1664)
1 parent0037954 commit8d029e7

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
exportdefaultasyncfunctionhtml(comments,localConfig={}){
2020
constconfig=awaitmergeConfig(localConfig);
21-
constthemePath=config.theme&&path.resolve(process.cwd(),config.theme);
21+
letthemePath=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(awaitimport(themePath)).default(comments,config);
2429
}
25-
2630
return(awaitimport('../default_theme/index.js')).default(comments,config);
2731
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp