package babel

import "github.com/gohugoio/hugo/resources/resource_transformers/babel"

Index

Types

type Client

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

Client is the client used to do Babel transformations.

func New

func New(rs *resources.Spec) *Client

New creates a new Client with the given specification.

func (*Client) Process

func (c *Client) Process(res resources.ResourceTransformer, options Options) (resource.Resource, error)

Process transforms the given Resource with the Babel processor.

type Options

type Options struct {
	Config string // Custom path to config file

	Minified   bool
	NoComments bool
	Compact    *bool
	Verbose    bool
	NoBabelrc  bool
	SourceMap  string
}

Options from https://babeljs.io/docs/en/options

func DecodeOptions

func DecodeOptions(m map[string]any) (opts Options, err error)

DecodeOptions decodes options to and generates command flags

Source Files

babel.go

Version
v0.144.2 (latest)
Published
Feb 19, 2025
Platform
linux/amd64
Imports
16 packages
Last checked
12 hours ago

Tools for package owners.