Documentation
¶
Overview ¶
Package esbuildsolid provides the esbuild plugins for building a Solid application entirely in Go.
result := api.Build(api.BuildOptions{
EntryPoints: []string{entry},
Bundle: true,
Plugins: []api.Plugin{
esbuildsolid.Transform(solid.Options{}),
esbuildsolid.Runtime(runtime.Config{Development: dev}),
},
})
Transform lowers Solid JSX; Runtime serves solid-js from the embedded copy so that no node_modules directory is required. Use Transform alone to keep resolving solid-js from disk.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Runtime ¶
Runtime returns a plugin that serves solid-js from the embedded copy, removing the need for a node_modules directory.
Both consumer code and the embedded modules themselves import bare specifiers such as "solid-js/web", so resolution is registered for the file namespace and for the plugin's own namespace.
func Transform ¶
Transform returns a plugin that lowers Solid JSX in every JSX and TSX file.
esbuild's own JSX transform is React-shaped and cannot produce Solid's template calls, so this must own every such file in the graph rather than just the entry point.
esbuild calls OnLoad concurrently across files. That is safe here: each call builds its own compiler state.
Types ¶
This section is empty.