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

Generated script tags don’t have defer #4304

Closed
surma opened this issue Mar 10, 2020 · 3 comments · Fixed by #6539
Closed

Generated script tags don’t have defer #4304

surma opened this issue Mar 10, 2020 · 3 comments · Fixed by #6539

Comments

@surma
Copy link

surma commented Mar 10, 2020

🐛 bug report

I have 2 entry points, index.html and profile.html, each of loading their own specific piece of JavaScript, index.js and profile.js. Both these JS files depend on a common dependency utils.js. If utils.js is big enough to become its own chunk, the resulting HTML contains an additional <script> tag for the common dependencies.

🎛 Configuration (.babelrc, package.json, cli command)

Please see repro repo

🤔 Expected Behavior

The <script> tag for the common dependency should have defer if the original <script> tag has a defer attribute. Same for async.

😯 Current Behavior

The <script> tag for the common dependency does not have any attributes and is therefore renderblocking.

💁 Possible Solution

🔦 Context

Normal web development.

💻 Code Sample

Please see repro repo

🌍 Your Environment

Software Version(s)
Parcel 2.0.0-alpha.3.2
Node v12.8.0
npm/Yarn 6.12.1
Operating System MacOS 10.15.3 (19D76)
@surma
Copy link
Author

surma commented Mar 10, 2020

(The part where the generated <script> tag is in the wrong position in the markup I filed under #4303)

@mischnic
Copy link
Member

Is the order of execution between two deferred/async script tags defined?

@surma
Copy link
Author

surma commented Mar 10, 2020

Yes. They execute in parse-order.

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

Successfully merging a pull request may close this issue.

3 participants