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

chunk order Not work well with html-webpack-plugin #18

Closed
e-cloud opened this issue Jul 8, 2016 · 3 comments
Closed

chunk order Not work well with html-webpack-plugin #18

e-cloud opened this issue Jul 8, 2016 · 3 comments

Comments

@e-cloud
Copy link
Contributor

e-cloud commented Jul 8, 2016

now the generated output is good, but when using with html-webpack-plugin, in my case, the generated script tag order is not what expected.

i.e. one possible result for now.

...
<script type="text/javascript" src="manifest_ed6c67841e.js"></script>
<script type="text/javascript" src="main_4c9ecd6b3d.js"></script>
<script type="text/javascript" src="vendor_265cd3b016.js"></script>
...

the expected result

<script type="text/javascript" src="manifest_ed6c67841e.js"></script>
<script type="text/javascript" src="vendor_265cd3b016.js"></script>
<script type="text/javascript" src="main_4c9ecd6b3d.js"></script>

i think this result is caused by the chunk order or priority.
As the manifest chunk is the entry chunk, of course i will have highest priority.
But the others' order is sorted by webpack. So, We should level up the extracted chunks priority.

However, i can't find a solution according to the webpack document.
Therefore I need someone's help.

@sokra, @bebraw, could you guys give some expertise?

@bebraw
Copy link

bebraw commented Jul 8, 2016

What does your html-webpack-plugin configuration look like? Which chunksSortMode are you using? Have you tried out different options for that?

@e-cloud
Copy link
Contributor Author

e-cloud commented Jul 9, 2016

@bebraw , i'm a fool. I didn't keep update with html-webpack-plugin for such a while. So, i did not notice there provides a chunksSortMode option.

As i tried the dependency value, things work as wanted.

Thank you for your guidance.

@e-cloud e-cloud closed this as completed Jul 9, 2016
@bebraw
Copy link

bebraw commented Jul 9, 2016

No problem. Great to hear you got it to work. 👍

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

No branches or pull requests

2 participants