minsrv

package module
v0.0.0-...-7564f0a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2019 License: MIT Imports: 3 Imported by: 0

README

Minify Your Web Assets without Node!

minsrv is a build tool that helps you minify and hash our CSS and Javascript files automatically, so that you don't have to set up webpack or any of the other Node tools.

It comes with two parts.

The minsrv CLI

This is a CLI that you can use to compress your JS, CSS and HTML, and put everything into new, hashed files

TODO: use pkger to embed everything into the binary

Middleware

This is middleware that does a few things:

  1. Intercepts HTML pages before they go back to the client
  2. Parses all of the <script> and <link> tags & changes the src and href (respectively) URLs to point to the newly hashed files
  3. Minifies the HTML and returns it to the client

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(mapping Mapping, next http.Handler) http.Handler

Types

type Mapping

type Mapping struct {
	// contains filtered or unexported fields
}

func NewMapping

func NewMapping() *Mapping

func (*Mapping) FileNameForPath

func (m *Mapping) FileNameForPath(path string) string

func (*Mapping) HashedFileName

func (m *Mapping) HashedFileName(fileName string) string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL