html-webpack-inline-chunk-plugin
html-webpack-inline-chunk-plugin copied to clipboard
`<script>` and `</script>` not escaped cause inlined chunk to break parsing
One of dependencies of the module being entry point to a chunk inlined with html-webpack-inline-chunk-plugin has core-js in it. It contains this line
https://github.com/zloirock/core-js/blob/a08b6d46ea3f02a33b17df552e73078b42c5b78f/client/shim.js#L1109
(minified it looks like this: t.write("<script>document.F=Object<\/script>"))
Inlined it looks like this:
<script type="text/javascript>/* ... */t.write("<script>document.F=Object</script>")/* ... */</script>
Which breaks parsing. The script tag needs to be escaped
Related: https://wls.wwco.com/blog/2007/04/25/using-script-in-a-javascript-literal/ (yeah, it's old but it's definitely on tipic)