Documentation
¶
Overview ¶
Package compiler runs TSX apps: App runs the bundle the nsgo tool compiled ahead (package bundler), or under go run and go test compiles the app's sources as it starts, and under nsgo dev follows the dev server's new bundles.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func App ¶
App returns the app whose TSX entry is entry in fsys, for nsgo.Run and nsgotest.Start. It runs the bundle the nsgo tool compiled ahead for entry when the build has one, so the app links no compiler; otherwise, under go run and go test, it compiles fsys's sources as it starts.
//go:embed *.tsx
var src embed.FS
func main() { nsgo.Run(compiler.App(src, "App.tsx")) }
func Bundled ¶
func Bundled(entry, script string)
Bundled gives App the script the nsgo tool compiled ahead for entry. The tool's builds call it from a file they add to the app's main package; apps do not.
func BundledChunks ¶
BundledChunks says that entry's bundle is split (bundler.CompileSplit) and where its chunks are, by key: URLs relative to the web page, which App fetches as the app's import()s need them. The tool's web builds call it with Bundled.
Types ¶
This section is empty.