File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,14 @@ import mergeConfig from '../merge_config.js';
18
18
*/
19
19
export default async function html ( comments , localConfig = { } ) {
20
20
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 ) ;
22
22
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
+
23
28
return ( await import ( themePath ) ) . default ( comments , config ) ;
24
29
}
25
-
26
30
return ( await import ( '../default_theme/index.js' ) ) . default ( comments , config ) ;
27
31
}
You can’t perform that action at this time.
0 commit comments