feat: support pre-compressed-assets#100
Open
curbengh wants to merge 6 commits into
Open
Conversation
Contributor
Author
|
WIP, haven't add test case. |
curbengh
force-pushed
the
pre-compressed
branch
from
October 5, 2019 06:21
79b95ce to
767dd6c
Compare
Member
|
I don't see how pre-compressed files can be served in hexo-server. I mean, most of the theme doesn't provide pre-compressed js & css. |
Contributor
Author
|
With a compression plugin like hexo-yam. How to test: package.json
- "hexo-server": "^1.0.0"
+ "hexo-server": "curbengh/hexo-server#pre-compressed",
+ "hexo-yam": "^3.1.0"_config.yml
+server:
+ pre_compressed: true$ rm -r node_modules/
$ npm i
$ hexo sCheck response header. |
curbengh
force-pushed
the
pre-compressed
branch
2 times, most recently
from
November 17, 2019 01:36
275b510 to
bf427b2
Compare
curbengh
marked this pull request as ready for review
November 17, 2019 01:38
Contributor
Author
|
Added test. |
curbengh
commented
Nov 17, 2019
Comment on lines
-40
to
-42
| extensions: | ||
| - html |
Contributor
Author
There was a problem hiding this comment.
Removed as they are not the default. User can always refer to https://github.com/expressjs/serve-static#options.
curbengh
force-pushed
the
pre-compressed
branch
2 times, most recently
from
November 17, 2019 01:58
00dedba to
713ce74
Compare
curbengh
commented
Dec 28, 2019
curbengh
force-pushed
the
pre-compressed
branch
from
December 28, 2019 00:47
8f75394 to
eb1c4f0
Compare
Contributor
Author
curbengh
marked this pull request as draft
June 27, 2020 10:53
- fix compatibility with trailing .html
curbengh
marked this pull request as ready for review
July 29, 2020 10:30
Contributor
|
I would say that hexo-server is a debug server only, not a prod server. Should absolutely not be used to serve a site except for testing! So in that context, really no need to have compression, pre compression, .... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Serve pre-compressed assets when found, else fallback to dynamic compression (when both
compressandpre_compressedare enabled).compressis independent frompre_compressed, so either one can be enabled.Adapted from pre-compressed-assets middleware plus this fix, with es6 syntax and utilize hexo router (instead of node-glob).