esmd

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: MIT Imports: 2 Imported by: 0

README

esmd

ESM Builder for esm.sh

Installation

go get github.com/esm-dev/esmd

Usage

import "github.com/esm-dev/esmd"

esm := esmd.New(esmd.Config{ ... })

// build instantly
output, err := esm.Build(esm.BuildOption{
  Name: "react-dom",
  Version: "18",
  Target: "es2020",
  Deps: esm.Deps {
    "react": "18",
  },
})
fmt.Println(esm.Get(output.id).Content)

// serve as http
http.HandleFunc("/esm", func(w http.ResponseWriter, r *http.Request){
  esmd.Serve(w, r)
})

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...func(c *config))

func WithFrontendEmbedFS deprecated

func WithFrontendEmbedFS(frontendEmbedFS server.EmbedFS) func(c *config)

WithFrontendEmbedFS allows configuring a frontend specific embedded file system

Deprecated: this is temporary while migrating this out to consuming code

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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