Skip to content

Commit fc1dca0

Browse files
authored
fix: fixing failed build (#4)
* fix: fixing failed build * docs: update doc deprecated minifier attribute * docs: update docs Todo list
1 parent 8ca8b1a commit fc1dca0

File tree

10 files changed

+557
-536
lines changed

10 files changed

+557
-536
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
caddy
1+
caddy
2+
.DS_Store

Makefile

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
check-module:
22
@xcaddy list-modules
33

4-
run-module:
5-
xcaddy run -c example/caddy.json
6-
7-
run-module-caddy:
8-
xcaddy run -c example/Caddyfile
9-
104
build-module:
11-
xcaddy build v2.7.6 --with github.com/devetek/caddyserver-minifier@main=./
5+
xcaddy build v2.10.0 --with github.com/devetek/caddyserver-minifier@main=./
6+
7+
run-jsonfile:
8+
./caddy run --config example/caddy.json
129

13-
run-build-module:
14-
./caddy run -c example/caddy.json
10+
run-caddyfile:
11+
./caddy run --config example/Caddyfile
1512

1613
run-test:
1714
@go test -v -cover ./...

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ http://localhost:9200 {
3939
route {
4040
minifier {
4141
html {
42-
KeepConditionalComments true
4342
KeepSpecialComments true
4443
KeepComments true
4544
KeepWhitespace true
@@ -56,6 +55,7 @@ http://localhost:9200 {
5655

5756
## Todo
5857

58+
- [ ] add Github Action CI to main code quality
5959
- [ ] Support for another `Content-Type` (css, js, etc):
6060

6161
```sh

caddyfile.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,6 @@ func (m *Middleware) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
104104
m.Html.KeepQuotes = converterStrToBoolean(d.Val())
105105
}
106106

107-
if d.Val() == "KeepConditionalComments" {
108-
// get value from config
109-
d.NextArg()
110-
m.Html.KeepConditionalComments = converterStrToBoolean(d.Val())
111-
}
112-
113107
if d.Val() == "KeepSpecialComments" {
114108
// get value from config
115109
d.NextArg()

example/Caddyfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ http://localhost:9200 {
33
encode zstd gzip
44
minifier {
55
html {
6-
KeepConditionalComments true
76
KeepSpecialComments true
87
KeepComments true
98
KeepWhitespace true
@@ -13,6 +12,6 @@ http://localhost:9200 {
1312
KeepQuotes true
1413
}
1514
}
16-
reverse_proxy localhost:8097
15+
reverse_proxy localhost:3000
1716
}
1817
}

example/caddy-2.json

Lines changed: 0 additions & 43 deletions
This file was deleted.

example/caddy.json

Lines changed: 68 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,84 @@
22
"apps": {
33
"http": {
44
"servers": {
5-
"example": {
6-
"listen": [":9200"],
5+
"srv0": {
6+
"listen": [
7+
":9200"
8+
],
79
"routes": [
810
{
9-
"match": [{ "host": ["localhost"] }],
10-
"handle": [
11+
"match": [
1112
{
12-
"handler": "minifier"
13-
},
13+
"host": [
14+
"localhost"
15+
]
16+
}
17+
],
18+
"handle": [
1419
{
15-
"handler": "reverse_proxy",
16-
"upstreams": [
20+
"handler": "subroute",
21+
"routes": [
1722
{
18-
"dial": "localhost:8097"
23+
"handle": [
24+
{
25+
"handler": "subroute",
26+
"routes": [
27+
{
28+
"handle": [
29+
{
30+
"encodings": {
31+
"gzip": {},
32+
"zstd": {}
33+
},
34+
"handler": "encode",
35+
"prefer": [
36+
"zstd",
37+
"gzip"
38+
]
39+
},
40+
{
41+
"Html": {
42+
"KeepComments": true,
43+
"KeepDefaultAttrVals": true,
44+
"KeepDocumentTags": true,
45+
"KeepEndTags": true,
46+
"KeepQuotes": true,
47+
"KeepSpecialComments": true,
48+
"KeepWhitespace": true,
49+
"TemplateDelims": [
50+
"",
51+
""
52+
]
53+
},
54+
"handler": "minifier"
55+
},
56+
{
57+
"handler": "reverse_proxy",
58+
"upstreams": [
59+
{
60+
"dial": "localhost:3000"
61+
}
62+
]
63+
}
64+
]
65+
}
66+
]
67+
}
68+
]
1969
}
2070
]
2171
}
22-
]
72+
],
73+
"terminal": true
2374
}
24-
]
75+
],
76+
"automatic_https": {
77+
"skip": [
78+
"localhost"
79+
]
80+
}
2581
}
2682
}
2783
}
2884
}
29-
}
85+
}

0 commit comments

Comments
 (0)