Generates a minified file under inst/pkg_name-pkg_version, if mode is prod. If mode is dev, aggregates all js files without mangling or compression.
Usage
build_js(dir = "srcjs", mode = c("prod", "dev"), entry_points = "main.js")
Arguments
- dir
Default to srcjs.
- mode
Production or development mode. Choose either "prod" or "dev". "prod" bundles, aggregates and minifyies files. "dev" only bundles the code. Modules follow the ES6 format (import/export).
- entry_points
Entry point(s) to use in esbuild configuration. In case of a monolithic bundle, only one entrypoint is needed. This the default. In case of component based bundles, a vector of entrypoints is needed. The output files will match the entrypoints names.