mirror of
https://github.com/tcsenpai/Zundler.git
synced 2025-06-08 12:35:39 +00:00
Fix source URL pragmas
This commit is contained in:
parent
b99d1c2977
commit
f7530f8ff9
@ -91,7 +91,7 @@ var embed_js = function(doc) {
|
|||||||
let [path, get_parameters, anchor] = split_url(src);
|
let [path, get_parameters, anchor] = split_url(src);
|
||||||
path = normalize_path(path);
|
path = normalize_path(path);
|
||||||
console.debug("Embed script: " + path);
|
console.debug("Embed script: " + path);
|
||||||
var src = retrieve_file(path) + ' //# sourceMap=' + path;
|
var src = retrieve_file(path) + ' \n//# sourceURL=' + path;
|
||||||
newScript.appendChild(doc.createTextNode(src));
|
newScript.appendChild(doc.createTextNode(src));
|
||||||
newScript.removeAttribute('src');
|
newScript.removeAttribute('src');
|
||||||
oldScript.parentNode.replaceChild(newScript, oldScript);
|
oldScript.parentNode.replaceChild(newScript, oldScript);
|
||||||
|
@ -93,8 +93,8 @@ def embed_assets(index_file, output_path=None, append_pre="", append_post=""):
|
|||||||
<head><style>{style}</style></head>
|
<head><style>{style}</style></head>
|
||||||
<body>{body}
|
<body>{body}
|
||||||
<script>window.global_context = "{global_context}"</script>
|
<script>window.global_context = "{global_context}"</script>
|
||||||
<script>{pako} //# sourceURL=pako.js</script>
|
<script>{pako} \n//# sourceURL=pako.js</script>
|
||||||
<script>{bootstrap} //# sourceURL=boostrap.js</script>
|
<script>{bootstrap} \n//# sourceURL=boostrap.js</script>
|
||||||
</body><!-- {license} --></html>
|
</body><!-- {license} --></html>
|
||||||
""".format(
|
""".format(
|
||||||
style=init_files["init.css"],
|
style=init_files["init.css"],
|
||||||
@ -193,12 +193,12 @@ def embed_html_resources(html, base_dir, before, after):
|
|||||||
|
|
||||||
if head and before:
|
if head and before:
|
||||||
script = soup.new_tag("script")
|
script = soup.new_tag("script")
|
||||||
script.string = before + "//# sourceURL=inject_pre.js"
|
script.string = before + "\n//# sourceURL=inject_pre.js"
|
||||||
head.insert(0, script)
|
head.insert(0, script)
|
||||||
|
|
||||||
if body and after:
|
if body and after:
|
||||||
script = soup.new_tag("script")
|
script = soup.new_tag("script")
|
||||||
script.string = after + "//# sourceURL=inject_post.js"
|
script.string = after + "\n//# sourceURL=inject_post.js"
|
||||||
body.append(script)
|
body.append(script)
|
||||||
|
|
||||||
# TODO embed remote resources in case we want the entire file to be
|
# TODO embed remote resources in case we want the entire file to be
|
||||||
|
Loading…
x
Reference in New Issue
Block a user