app

package
v0.0.0-...-a81022f Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Conf struct
	Conf struct {
		ConfigFile string   // build tasks are relative to this config
		WorkingDir string   // working directory is the base directory of the config file
		CleanDirs  []string // is set, this directory will be deleted with clean
		Tasks      []TaskStruct
	}

	// Minify determines whether to minify the styles and scripts
	Minify bool
)
View Source
var (

	// VerboseLogging - verbose logging
	VerboseLogging bool

	// QuietLogging - no logging
	QuietLogging bool
)
View Source
var OptimiserConfig struct {
	// contains filtered or unexported fields
}

OptimiserConfig is the configuration for the optimiser

Functions

func Clean

func Clean() error

Clean deletes all matching files or directories defined in the yaml config

func Log

func Log() *logrus.Logger

Log returns the logger instance

func ParseConfig

func ParseConfig() error

ParseConfig reads a yaml file and returns a Conf struct

func WatchSrcDirs

func WatchSrcDirs()

WatchSrcDirs will start a watcher at the highest level of the src directories

Types

type ByLen

type ByLen []string

ByLen struct for sorting shortest to longest

func (ByLen) Len

func (a ByLen) Len() int

func (ByLen) Less

func (a ByLen) Less(i, j int) bool

func (ByLen) Swap

func (a ByLen) Swap(i, j int)

type FileMap

type FileMap struct {
	InFile  string
	OutPath string
}

FileMap struct maps the file to the respective dist directory

type TaskStruct

type TaskStruct struct {
	Type           string   // styles, scripts, copy
	Name           string   // name of the task
	Src            []string // source files
	Dist           string   // dist directory
	DistFile       string   // optional merge filename
	NoSourceMaps   bool     // optional no SourceMaps (SAS/JS)
	JSBundle       bool     // optional bundle JS files (JS)
	OptimiseImages bool     `yaml:"optimise_images"`
	SVGPrecision   int      `yaml:"svg_precision"`
}

TaskStruct for config

func (TaskStruct) Files

func (t TaskStruct) Files() []FileMap

Files returns all files matching the glob pattern

func (TaskStruct) Process

func (task TaskStruct) Process(fileName string) error

Process the TaskStruct

Jump to

Keyboard shortcuts

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