Move the unhomoglyph data to its own file (#26095)

This solves problems wherein the javascript debugger would get confused and
show the execution point two lines away from the source.
pull/26122/head
Richard van der Hoff 2023-09-01 15:37:09 +01:00 committed by GitHub
parent bff5b6e8e2
commit 00803950bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 1 deletions

View File

@ -61,7 +61,16 @@
<body style="height: 100%; margin: 0;">
<noscript>Sorry, Element requires JavaScript to be enabled.</noscript> <!-- TODO: Translate this? -->
<section id="matrixchat" style="height: 100%;" class="notranslate"></section>
<script src="<%= htmlWebpackPlugin.files.js.find(entry => entry.includes("bundle.js")) %>"></script>
<%
// insert <script> tags for the JS entry points
for (let file of htmlWebpackPlugin.files.js) {
if (file.includes("bundle.js") || file.includes("unhomoglyph_data")) {
%> <script src="<%= file %>"></script>
<%
}
}
%>
<!-- Legacy supporting Prefetch images -->
<img src="<%= require('matrix-react-sdk/res/img/warning.svg').default %>" aria-hidden alt="" width="24" height="23" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>

View File

@ -171,6 +171,17 @@ module.exports = (env, argv) => {
enforce: true,
// Do not add `chunks: 'all'` here because you'll break the app entry point.
},
// put the unhomoglyph data in its own file. It contains
// magic characters which mess up line numbers in the
// javascript debugger.
unhomoglyph_data: {
name: "unhomoglyph_data",
test: /unhomoglyph\/data\.json$/,
enforce: true,
chunks: "all",
},
default: {
reuseExistingChunk: true,
},