New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inline Javascript (<script> tag) always get minified in html #4455
Comments
The
That should definitely not happen. |
Your code sample works correctly for me. |
Hi @mischnic, Are you not getting the error in console or Parcel doesn't change the quotes post bundling? |
With this input <script>
var a = JSON.parse('{"a": 1}');
console.log(a);
</script> the output is <script>var a=JSON.parse('{"a": 1}');console.log(a);</script> |
My exact code is which converts to Code inside Expected Output: |
I see, this is caused by terser, add this {
"output": {"quote_style": 3}
} |
Tried it, doesn't work for me. Does it work for you? |
Yes: https://github.com/mischnic/parcel-issue-4455. I do indeed get:
|
Worked after deleting .cache folder and bundling again. Anyway, Thanks for the help. |
馃悰bug report
Inline Javascript (<script> tag) always get minified in entry/index html
Tried according to htmlnano documentation by giving htmlnano key in package.json as
But Javascript inside script tag in index.html still minifies.
Issue faced is that I want to escape replacement of single quote to double quotes when Parcel Bundles application.
馃 Expected Behavior
There should be a way to escape JS minification in html files or to not touch quotes during minification.
馃槸 Current Behavior
Not able to escape inline JS minification inside html.
馃敠 Context
Came across this PR #1456, which introduced changes for processing inline styles and scripts, is there way to skip inline JS minification or changing quotes during minification.
馃捇 Code Sample
Converts to
post bundling.
Which breaks in browser with error
Uncaught SyntaxError: missing ) after argument list
as string parsing fails.馃實 Your Environment
The text was updated successfully, but these errors were encountered: