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

Precompress and optimize static files during build and serve them to browsers #1030

Closed

Conversation

gmokki
Copy link

@gmokki gmokki commented Nov 23, 2016

The PR is done - it:

  • follows the style and naming rules (passes npm run lint)
  • doesn't break anything (passes npm run test-local and npm run test-browserstack)
  • any changed files are transformed to ES6

Changes:

  • create precompressed variants of js, css, svg files: gz using zopfli and br using brotli

Currently using forked versions of expressjs/send/negotiator while waiting for the PRs to go through:

@hannesj
Copy link
Contributor

hannesj commented Nov 23, 2016

Is there some reason not to use a ready-made plugin like https://webpack.js.org/plugins/compression-webpack-plugin/ for the compression of the assets?

@gmokki
Copy link
Author

gmokki commented Nov 24, 2016

Only familiarity of basic unix tools.

I can try to use webpack plugins:

Or maybe I will just leave the image optimizations out of this PR...

@hannesj
Copy link
Contributor

hannesj commented Nov 24, 2016

I think the imagemin-zopfli plugin can be added using this

@hannesj
Copy link
Contributor

hannesj commented Nov 24, 2016

Also check #1031 where we have included the svgs to be bundled using webpack.

…the browsers.

- create precompressed variants of js, css, svg files: gz using zopfli and br using brotli

Currently using forked versions of expressjs/send/negotiator while waiting for the PRs to go through:
- jshttp/negotiator#49
- pillarjs/send#108
hannesj added a commit that referenced this pull request Dec 5, 2016
@hannesj
Copy link
Contributor

hannesj commented Dec 5, 2016

Implemented the serving using a different express middleware, so we can use the vanilla express version.

See cc2c7f0

@hannesj hannesj closed this Dec 5, 2016
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