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

Using Compression plugin alongside 'html-webpack-plugin' #57

Closed
retwedt opened this issue May 16, 2017 · 8 comments · Fixed by #71
Closed

Using Compression plugin alongside 'html-webpack-plugin' #57

retwedt opened this issue May 16, 2017 · 8 comments · Fixed by #71

Comments

@retwedt
Copy link

retwedt commented May 16, 2017

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!

@retwedt
Copy link
Author

retwedt commented May 16, 2017

Apparently this is a duplicate of #45

@farhan687
Copy link

No update even after a month?

@lucasvinals
Copy link

Hi guys, I've just wrote a simple plugin to connect both plugins.
It just listen for HtmlWebpackPlugin to complete it's build and then change the extensions to files that you specify.

You can download with yarn add change-extension-plugin or npm install change-extension-plugin --save. Cheers! 😃

@retwedt
Copy link
Author

retwedt commented Jun 30, 2017

@lucasvinals Awesome I will check it out!

@nrandell
Copy link

nrandell commented Aug 4, 2017

I ran into this same problem today and pulled together a simple plugin based on the brotli-webpack-plugin that supports both brotli and gzip compression.
Have a look at brotli-gzip-webpack-plugin that I've shamlessly copied and modified from others. Hopefully it will help until the pull request to fix this gets accepted.

@michael-ciniawsky michael-ciniawsky added this to the 1.1.0 milestone Sep 3, 2017
@michael-ciniawsky michael-ciniawsky changed the title Using Compression plugin alongside Html Webpack plugin Using Compression plugin alongside 'html-webpack-plugin' Sep 3, 2017
@marcoturi
Copy link

@d3viant0ne Now that the PR is merged and published, can you show how to use this plugin with html-webpack-plugin? Thank you

@michael-ciniawsky michael-ciniawsky removed this from the 1.1.0 milestone Dec 14, 2017
@urikphytech
Copy link

Hi, I also can't find any documentation on how to make this work with html-webpack-plugin (i.e. have html-webpack-plugin write the path with the correct file extension).

Can anyone here point me in the right direction? I'd be happy to document it.
Thanks!

@nerdmax
Copy link

nerdmax commented Feb 25, 2019

Just in case some one else find this issue later.

If you are using html-webpack-plugin along side compression-webpack-plugin and you want the html-webpack-plugin to reference the .gz file automatically.

You can try this plugin: html-webpack-change-assets-extension-plugin.

Eg:

plugins: [
  new HtmlWebpackPlugin({
    jsExtension: ".gz"
  }),
  new CompressionPlugin(), // compression plugin will generate the xxx.js.gz file
  new HtmlWebpackChangeAssetsExtensionPlugin()
];

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.

8 participants