|
@@ -1,44 +0,0 @@
|
|
|
-package modules
|
|
|
-
|
|
|
-import (
|
|
|
- "regexp"
|
|
|
-
|
|
|
- "github.com/tdewolff/minify"
|
|
|
- "github.com/tdewolff/minify/css"
|
|
|
- "github.com/tdewolff/minify/html"
|
|
|
- "github.com/tdewolff/minify/js"
|
|
|
- "github.com/tdewolff/minify/json"
|
|
|
- "github.com/tdewolff/minify/svg"
|
|
|
- "github.com/tdewolff/minify/xml"
|
|
|
-)
|
|
|
-
|
|
|
-func Compile() {
|
|
|
- m := minify.New()
|
|
|
- m.AddFunc("text/css", css.Minify)
|
|
|
- m.AddFunc("text/html", html.Minify)
|
|
|
- m.AddFunc("image/svg+xml", svg.Minify)
|
|
|
- m.AddFuncRegexp(regexp.MustCompile("^(application|text)/(x-)?(java|ecma)script$"), js.Minify)
|
|
|
- m.AddFuncRegexp(regexp.MustCompile("[/+]json$"), json.Minify)
|
|
|
- m.AddFuncRegexp(regexp.MustCompile("[/+]xml$"), xml.Minify)
|
|
|
-
|
|
|
- // items, _ := ioutil.ReadDir("./private")
|
|
|
- // for _, item := range items {
|
|
|
- // if item.IsDir() {
|
|
|
- // subitems, _ := ioutil.ReadDir(item.Name())
|
|
|
- // for _, subitem := range subitems {
|
|
|
- // if !subitem.IsDir() {
|
|
|
- // // handle file there
|
|
|
- // fmt.Println(item.Name() + "/" + subitem.Name())
|
|
|
- // }
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // // handle file there
|
|
|
- // fmt.Println(item.Name())
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // s, err = m.String(mediatype, s)
|
|
|
- // if err != nil {
|
|
|
- // panic(err)
|
|
|
- // }
|
|
|
-}
|