Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Build alter inlined javascript #1297

Closed
L-Naej opened this issue May 4, 2018 · 1 comment
Closed

🐛 Build alter inlined javascript #1297

L-Naej opened this issue May 4, 2018 · 1 comment
Labels

Comments

@L-Naej
Copy link

L-Naej commented May 4, 2018

🐛 bug report

Hello,
When I'm using parcel-cli "parcel build src/index.html --public-url ./ --out-dir build/" the output alter inline JS leading to not working code. This does not happen when using parcel src/index.html (bundled server).

🤔 Expected Behavior

The inlined JS should not be changed.

😯 Current Behavior

The inlined JS in my HTML is being wrongly altered.
How it is in my source file :

<link rel="stylesheet" href="less/incarna.less" media="none" onload="if(media!='all')media='all';">

The output in build/index.html:

<link rel="stylesheet" href="incarna.3defd595.css" media="none" onload=""all"!=media&&(media="all")"> 

As you can see, if(media!='all')media='all'; as been translated to "all"!=media&&(media="all")

💁 Possible Solution
I have no idea!

🔦 Context
Doing a simple landing page using UIKIT.

🌍 Your Environment
I'm using VIsualStudioCode.

@DeMoorJasper
Copy link
Member

This is probably because htmlnano minifies js. Didn’t know it changed inlined js though, probably changing a setting would fix this

Sent with GitHawk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants