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

fix: Disable chunk sorting in HtmlWebpackPlugin #47

Merged
merged 1 commit into from
Feb 13, 2019

Conversation

grncdr
Copy link
Contributor

@grncdr grncdr commented Jan 31, 2019

Webpack >= 4 doesn't need chunks to be sorted, and this option can cause builds to fail with errors that are difficult to debug.

In my case Webpack created circularly dependent chunks even after removing any circular imports in the module graph. As I mentioned above, the error that gets thrown is especially unhelpful:

$project/node_modules/toposort/index.j
s:35
      throw new Error('Cyclic dependency' + nodeRep)
      ^

Error: Cyclic dependency
    at visit ($project/node_modules/toposort/index.js:35:13)
<-- snipped about 30 more stack frames -->

With a bit of research I found jantimon/html-webpack-plugin#870 (comment) which suggests chunksSortMode: 'none' as a workaround, and I've verified this prevents the error for my project. It also seems that this has been made the default in jantimon/html-webpack-plugin#953, but that change hasn't made it's way into an official release yet, so I'd greatly appreciate it if this small patch could be merged/released faster here.

Webpack >= 4 doesn't need chunks to be sorted, and this option can cause builds to fail with hard to debug errors.
@grncdr grncdr changed the title Disable chunk sorting in HtmlWebpackPlugin fix: Disable chunk sorting in HtmlWebpackPlugin Jan 31, 2019
@markdalgleish markdalgleish merged commit 03e8dc1 into seek-oss:master Feb 13, 2019
@markdalgleish
Copy link
Member

Out now in v0.7.2. Thanks for the PR 👏

@grncdr grncdr deleted the patch-1 branch August 12, 2019 12:31
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

Successfully merging this pull request may close these issues.

None yet

2 participants