processor

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLoader

func GetLoader(ext string) api.Loader

GetLoader determines the appropriate esbuild loader based on the file extension.

Types

type FileProcessor

type FileProcessor interface {
	Process(inputFilePath, outputFilePath, markerName string) error
}

FileProcessor is an interface for processing files.

type MinifierProcessor

type MinifierProcessor struct {
	Transform func(string) (string, error) // Transformation function
}

func (*MinifierProcessor) Process

func (p *MinifierProcessor) Process(inputFilePath, outputFilePath, markerName string) error

type PassthroughProcessor

type PassthroughProcessor struct{}

StandardProcessor processes files without modifications.

func (*PassthroughProcessor) Process

func (p *PassthroughProcessor) Process(inputFilePath, outputFilePath, markerName string) error

Process simply inserts the raw content from the input file into the output file.

type ProcessorFactory

type ProcessorFactory struct {
	Production bool // Whether to use minification
}

ProcessorFactory provides the correct FileProcessor based on file extension.

func (*ProcessorFactory) GetProcessor

func (f *ProcessorFactory) GetProcessor(filePath string) FileProcessor

GetProcessor returns the appropriate FileProcessor.

type ProcessorFactoryInterface

type ProcessorFactoryInterface interface {
	GetProcessor(filePath string) FileProcessor
}

ProcessorFactoryInterface defines the behavior of a processor factory.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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