-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Using Compression plugin alongside Html Webpack plugin #678
Comments
duplicate of #61 It's something that out of your control, you will need to wait for the release of compression-webpack-plugin@1 |
Thanks! |
has there been a update on this? Looks like the PR for the issue in the compression is merged but still i am not seeing the gzipped file being updated in the script tag. |
Hi there-- any movement here? Using |
The While the Line 90 in 75eef88
My guess it that you registered To prevent this behaviour we would have to adjust the |
Thanks for the reply. I'm not quite understanding-- so this bug is not fixed? Or are you saying there is a workaround? |
Please make sure that the html-webpack-plugin is first in your plugins array - then it should work. |
Have same issue, but after looking further into it, I've concluded that this is actually a web server problem; you can't have a .gz source in your script tag src attribute; your web server should be configured to return the gzipped version of your bundle when receiving the request in production mode. Here is an example way to do it with nginx: http://nginx.org/en/docs/http/ngx_http_gzip_static_module.html |
@jantimon I will try presently. @noobG This is not a webserver problem. I already have Apache configured to serve with correct headers as I'm serving other assets that way. Regardless of what you name it (.js or .gz), in this case the plugin does not insert the output of the plugin before it. It presents as a bug. The point of an array is to order elements, and in this case you have to unorder them-- a bit of a screwy interface IMO. |
If it's a plugin position issue, we can fix that by using the |
@mastilver that's a cool idea |
I tried reordering them, but it had no effect. |
Hi there, I'm unclear on how to proceed. This cannot be an uncommon use case, right? Gzip build -> add script tag? What am I missing? |
@thegoldenmule I think the problem is that the webpack plugin pipeline is a series of functions that operate sequentially on the webpack output (correct me if I'm wrong); if this is the case, html-webpack-plugin can't (and shouldn't) assume arbitrary files added by prior plugins are meant to go in the script tag Did some digging and found the actual place the script tags seem to be inserted, and it looks like the logic is simply to add a script tag for each js asset https://github.com/jantimon/html-webpack-plugin/blob/master/index.js#L513 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Is it possible to make the Html Webpack plugin insert a link to the .gz build file instead of the normal .js build file?
Is this even the right place to ask this question??
Thanks for your help, and thanks for your work on a great plugin!
The text was updated successfully, but these errors were encountered: