babel

package
v0.123.13 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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

Jump to

Keyboard shortcuts

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