hugo: github.com/gohugoio/hugo/resources/resource_transformers/js Index | Files

package js

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

Index

Package Files

build.go

type Client Uses

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

func New Uses

func New(fs *filesystems.SourceFilesystem, rs *resources.Spec) *Client

func (*Client) Process Uses

func (c *Client) Process(res resources.ResourceTransformer, opts map[string]interface{}) (resource.Resource, error)

type Options Uses

type Options struct {
    // If not set, the source path will be used as the base target path.
    // Note that the target path's extension may change if the target MIME type
    // is different, e.g. when the source is TypeScript.
    TargetPath string

    // Whether to minify to output.
    Minify bool

    // Whether to write mapfiles (currently inline only)
    SourceMap string

    // The language target.
    // One of: es2015, es2016, es2017, es2018, es2019, es2020 or esnext.
    // Default is esnext.
    Target string

    // The output format.
    // One of: iife, cjs, esm
    // Default is to esm.
    Format string

    // External dependencies, e.g. "react".
    Externals []string `hash:"set"`

    // User defined symbols.
    Defines map[string]interface{}

    // What to use instead of React.createElement.
    JSXFactory string

    // What to use instead of React.Fragment.
    JSXFragment string
    // contains filtered or unexported fields
}

Package js imports 13 packages (graph) and is imported by 4 packages. Updated 2020-09-03. Refresh now. Tools for package owners.