dependencyLoader

package
v0.0.0-...-8a04328 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2018 License: GPL-3.0, GPL-3.0-only Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SPECIAL_EXTERNAL_CSS_FILES = map[string]string{
	"react-mdl": "material.min.css",
}
View Source
var SPECIAL_EXTERNAL_JS_FILES = map[string][]string{
	"react-mdl": {
		"material.min.js",
		"ReactMDL.min.js",
	},
}

Functions

func AddExternalJavascript

func AddExternalJavascript(url string)

AddExternalJavascript adds an external javascript to the site. The url must be valid and should be `https`

func GetExternalJavascripts

func GetExternalJavascripts() []string

GetExternalJavascripts returns all external javascripts to be included on every webpage

Types

type External

type External struct {
	Name    string
	Version string
	HasCss  bool
	HasJs   bool
	JsUrls  []string
	CssUrls []string

	JsFiles  []string
	CssFiles []string

	FileDirectoryMapping map[string]string
}

External is an external resource loaded onto the webpage (react, immutable, ...) The struct contains all the information to generate the urls and to locate the files

func NewExternal

func NewExternal(name string, version string) External

NewExternal creates a new external with the given name and version

func (*External) SetUrl

func (e *External) SetUrl()

SetUrl generates all css and js urls for this external

type ExternalFileExtractor

type ExternalFileExtractor struct {
	Externals []External
}

func NewExternalFileExtractor

func NewExternalFileExtractor(externals []External) *ExternalFileExtractor

func (*ExternalFileExtractor) LookupExternalFiles

func (e *ExternalFileExtractor) LookupExternalFiles() []External

this function looks up the external files. It tries an exact match with the external name, for exceptions define the file to use in `specialFiles.go` FIXME too much duplicated code...

type ExternalsExtractor

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

func NewExtractor

func NewExtractor(webpackPath string, packagePath string) *ExternalsExtractor

NewExtractor returns a new ExternalsExtractor. Given paths are treated relatively to suluvir base directory

func (*ExternalsExtractor) ExtractExternals

func (e *ExternalsExtractor) ExtractExternals() []External

func (*ExternalsExtractor) GetSuluvirExternal

func (e *ExternalsExtractor) GetSuluvirExternal() External

Jump to

Keyboard shortcuts

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