Skip to content

Commit 52ebed8

Browse files
committed
fix: build
1 parent c54614a commit 52ebed8

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

packages/core/src/Html/Html.ts

+10-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ class Html {
2525
path = path.replace(/^\//, '');
2626
path = path.replace(/\/$/, '');
2727

28-
if (this.config.exportStatic?.htmlSuffix || path === 'index.html') {
28+
if (
29+
(this.config.exportStatic && this.config.exportStatic.htmlSuffix) ||
30+
path === 'index.html'
31+
) {
2932
return `${path}`;
3033
} else {
3134
return `${path}/index.html`;
@@ -36,8 +39,11 @@ class Html {
3639
const htmlPath = this.getHtmlPath(path);
3740
const len = htmlPath.split('/').length;
3841
return (
39-
Array(this.config.exportStatic?.htmlSuffix ? len : len - 1).join('../') ||
40-
'./'
42+
Array(
43+
this.config.exportStatic && this.config.exportStatic.htmlSuffix
44+
? len
45+
: len - 1,
46+
).join('../') || './'
4147
);
4248
}
4349

@@ -46,7 +52,7 @@ class Html {
4652
return opts.file;
4753
}
4854
const file = opts.file.charAt(0) === '/' ? opts.file.slice(1) : opts.file;
49-
if (this.config.exportStatic?.dynamicRoot) {
55+
if (this.config.exportStatic && this.config.exportStatic.dynamicRoot) {
5056
return `${this.getRelPathToPublicPath(opts.path || '/')}${file}`;
5157
} else {
5258
return `${this.config.publicPath}${file}`;

0 commit comments

Comments
 (0)