0.0.5 • Published 1 year ago

@es-exec/api v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

ES Exec Api

An api that builds and runs a program.

Installation

npm

npm install --save-dev @es-exec/api

yarn

yarn add --dev @es-exec/api

Usage

import esexec from '@es-exec/api';

/** @type import('es-exec/api').ESExecOptions */
const options = {
    ..., // Any es-exec option.
    buildOptions: {
        ... // Any esbuild option.
    }
};

esexec(options)

Options

All fields are optional, but either buildOptions or esbuildConfig should be set with at least one entrypoint file in order to properly build the project.

NameTypeDescription
buildOptionsBuildOptionsEsbuild options to use when building the project. Will overwrite all values in the specified esbuildConfig.
cleanbooleanCleans the outdir folder.
envNodeJS.ProcessEnvEnvironment variables to pass onto the child process that starts the project.
esbuildConfigstringThe esbuild configuration file to use to build the project.
lintbooleanIf true, lints the project files using @es-exec/esbuild-plugin-eslint.
lintFixbooleanIf true, will fix lint problems found in the project.
mainstringThe file to run in a child process using @es-exec/esbuild-plugin-serve. If no main is set, will serve the outfile from the esbuild options.
scriptstringCLI script to run after the package is build. If set, will use `@es-exec/esbuild-plugin-start to run the script.
singleLintbooleanIf true, runs @es-exec/esbuild-plugin-eslint in single mode.
useExternalbooleanIf true, uses dependencies and peer dependencies in node_modules as external.
verbosebooleanUseful for debugging.
watchbooleanDefaults to true. If false, will not run esbuild in watch mode. If true or not set, will run esbuild in watch mode.