-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: open editor when clicking error on overlay (#4587)
- Loading branch information
1 parent
bce65af
commit efb2cec
Showing
9 changed files
with
139 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -184,7 +184,7 @@ function formatProblem(type, item) { | |
// Compilation with errors (e.g. syntax error or missing modules). | ||
/** | ||
* @param {string} type | ||
* @param {Array<string | { file?: string, moduleName?: string, loc?: string, message?: string }>} messages | ||
* @param {Array<string | { moduleIdentifier?: string, moduleName?: string, loc?: string, message?: string }>} messages | ||
* @param {string | null} trustedTypesPolicyName | ||
*/ | ||
function show(type, messages, trustedTypesPolicyName) { | ||
|
@@ -203,6 +203,16 @@ function show(type, messages, trustedTypesPolicyName) { | |
typeElement.innerText = header; | ||
applyStyle(typeElement, msgTypeStyle); | ||
|
||
if (message.moduleIdentifier) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
malcolm-kee
Author
Contributor
|
||
applyStyle(typeElement, { cursor: "pointer" }); | ||
typeElement.dataset.canOpen = true; | ||
typeElement.addEventListener("click", () => { | ||
fetch( | ||
`/webpack-dev-server/open-editor?fileName=${message.moduleIdentifier}` | ||
); | ||
}); | ||
} | ||
|
||
// Make it look similar to our terminal. | ||
const text = ansiHTML(encode(body)); | ||
const messageTextNode = document.createElement("div"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This cause that when devServer.client.overlay is false can not stop show the mask!! Please check it @malcolm-kee