Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@
}
]
},
"historyApiFallback": {
"description": "When using the HTML5 History API, the index.html page will likely have to be served in place of any 404 responses. Enable historyApiFallback by setting it to true",
"anyOf": [
{
"type": "boolean"
}
]
},
"stats": {
"description": "Stats options object or preset name.",
"anyOf": [
Expand Down
5 changes: 4 additions & 1 deletion src/utils/getFilenameFromUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ export default function getFilenameFromUrl(context, url) {
filename = path.join(outputPath, querystring.unescape(pathname));
}

let fsStats;
if (!context.outputFileSystem.existsSync(filename) && options.historyApiFallback){
filename = path.join(outputPath);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need path.join here, it doesn't have sense

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will check. Look like mistake. May be we need change it to path.resolve

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now this code looks like this option is not necessarily at all.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything should work without this option.
I am confused.
I feel that i need cancel this PR.

}

let fsStats;
try {
fsStats = context.outputFileSystem.statSync(filename);
} catch (_ignoreError) {
Expand Down