resolver

package
v0.5.21 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPackagePath added in v0.5.20

func IsPackagePath(path string) bool

Package paths are loaded from a "node_modules" directory. Non-package paths are relative or absolute paths.

Types

type ResolveResult added in v0.4.6

type ResolveResult struct {
	AbsolutePath string
	Status       ResolveStatus

	// If not empty, these should override the default values
	JSXFactory  []string // Default if empty: "React.createElement"
	JSXFragment []string // Default if empty: "React.Fragment"

	// If true, any ES6 imports to this file can be considered to have no side
	// effects. This means they should be removed if unused.
	IgnoreIfUnused bool

	// If true, the class field transform should use Object.defineProperty().
	StrictClassFields bool
}

type ResolveStatus

type ResolveStatus uint8
const (
	ResolveMissing ResolveStatus = iota
	ResolveEnabled
	ResolveDisabled
	ResolveExternalVerbatim
	ResolveExternalRelative
)

type Resolver

type Resolver interface {
	Resolve(sourcePath string, importPath string) ResolveResult
	ResolveAbs(absPath string) ResolveResult
	Read(path string) (string, bool)
	PrettyPath(path string) string
}

func NewResolver

func NewResolver(fs fs.FS, log logging.Log, options config.Options) Resolver

Jump to

Keyboard shortcuts

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