build

package
v0.6.35 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Doreload bool

Doreload and other flags should probably be part of a config accessible across build. It gets set using server flags.

View Source
var Local bool

Local is set to true when using dev webserver, otherwise bools default to false.

View Source
var Path404 string

Path404 stores path to 404 html fallback for use in local webserver

View Source
var SSRctx *v8go.Context

SSRctx is a v8go context for loaded with components needed to render HTML.

View Source
var ThemeFs afero.Fs

Virtual filesystem for doing theme builds without writing to disk. var ThemeFs = afero.NewMemMapFs()

Functions

func Benchmark

func Benchmark(start time.Time, message string, alwaysRun ...bool)

Benchmark records time for individual build processes.

func CheckBenchmarkFlag

func CheckBenchmarkFlag(flag bool)

CheckBenchmarkFlag sets global var if --benchmark flag is passed.

func CheckMinifyFlag added in v0.5.5

func CheckMinifyFlag(flag bool)

CheckMinifyFlag sets global var if --minify flag is passed.

func CheckVerboseFlag

func CheckVerboseFlag(flag bool)

CheckVerboseFlag sets global var if --verbose flag is passed.

func Client

func Client(spaPath string, coreFS embed.FS, compilerFS embed.FS) error

Client builds the SPA.

func DataSource

func DataSource(buildPath string, spaPath string, siteConfig readers.SiteConfig) error

DataSource builds json list from "content/" directory.

func EjectCopy

func EjectCopy(destPath string, coreFS embed.FS) error

EjectCopy does a direct copy of any ejectable js files needed in spa build dir.

func Gopack

func Gopack(buildPath, spaPath, entrypoint string) error

Gopack ensures ESM support for NPM dependencies.

func GopackDynamic added in v0.6.4

func GopackDynamic(buildPath string, spaPath string) error

Create ESM support for files that don't have static imports in the app

func Log

func Log(message string, alwaysRun ...bool)

Log displays verbose info to the terminal for individual build processes.

func MediaCopy added in v0.6.0

func MediaCopy(buildPath string, spaPath string) error

MediaCopy does a direct copy of any media files (e.g. images, PDFs).

func Minify added in v0.6.5

func Minify(buildPath string) error

func NpmDefaults

func NpmDefaults(defaultsNodeModulesFS embed.FS) error

NpmDefaults creates the node_modules folder with core defaults if it doesn't already exist.

func StaticCopy added in v0.6.0

func StaticCopy(buildPath string) error

StaticCopy does a direct copy of any static assets (e.g. global.css, robots.txt).

func ThemesClean

func ThemesClean(tempBuildDir string) error

ThemesClean removes temporary build directory used to compile themes.

func ThemesCopy

func ThemesCopy(theme string, themeOptions readers.ThemeOptions) error

ThemesCopy copies nested themes into a temporary, virtual working directory.

func ThemesMerge

func ThemesMerge(buildDir string) error

ThemesMerge combines any nested themes with the current project.

Types

type OutputCode added in v0.6.11

type OutputCode struct {
	JS  string
	CSS string
}

Jump to

Keyboard shortcuts

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