minify

package
v2.24.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package cssmin minifies CSS. It's a port of Ryan Grove's cssmin from Ruby.

Package htmlmin minifies HTML.

Package jsmin implements JavaScript minifier. It's a direct port of Doulas Crockford's JSMin.

Index

Constants

This section is empty.

Variables

View Source
var DefaultOptions = &Options{
	MinifyScripts: false,
	MinifyStyles:  false,
}
View Source
var FullOptions = &Options{
	MinifyScripts: true,
	MinifyStyles:  true,
}
View Source
var Minify = min.New()

Functions

func MinifyCSS

func MinifyCSS(css []byte) (minified []byte, err error)

func MinifyCSS2 added in v1.3.0

func MinifyCSS2(input []byte) ([]byte, error)

func MinifyHTML

func MinifyHTML(data []byte, options *Options) (out []byte, err error)

Minify returns minified version of the given HTML data. If passed options is nil, uses default options.

func MinifyHTML2 added in v1.3.0

func MinifyHTML2(input []byte) ([]byte, error)

func MinifyJS

func MinifyJS(script []byte) (minified []byte, err error)

Minify returns a minified script or an error.

func MinifyJS2 added in v1.3.0

func MinifyJS2(input []byte) ([]byte, error)

Types

type Options

type Options struct {
	MinifyScripts bool // if true, use jsmin to minify contents of script tags.
	MinifyStyles  bool // if true, use cssmin to minify contents of style tags and inline styles.
}

Jump to

Keyboard shortcuts

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