Version: 1.8.0

Start

Starting a Node.js application

The start command builds and starts a Node.js application in a single action.

To start a Node.js application run the following command:

ts-engine start
note

The build will be identical to that produced by running yarn ts-engine build --node-app.

Watching for changes

The start command also supports watching for changes to source code and rebuilding and restarting your Node.js application automatically when changes occur.

To start and trigger watch mode run the following command:

ts-engine start --watch
note

If the build fails following changes then the running application is not stopped.

note

The running application is stopped by sending the signal SIGTERM following changes.

Forwarding arguments

Arguments can be forwarded onto the Node.js application by using the --args option. All arguments following --args will be forwarded.

Forward args onto the Node.js application by running the following command:

The arguments --one --two=value file.txt will be forwarded.

ts-engine start --args --one --two=value file.txt

Minifying output

By default the build output is not minified. Terser is used to minify code if you provide the minify option.

To minify the output run the following command:

ts-engine start --minify

Typecheck post build

By default a typecheck is not performed during a build, there is a specific typecheck for that. You can do this with the typecheck option.

To typecheck post build run the following command:

ts-engine start --typecheck

You can also provide --emit option on the start command if you want to produce types definition files from your node app.

To typecheck and emit type definition files post build run the following command:

ts-engine start --typecheck --emit

React support

You can run codebases with React and JSX in them.

To support React run the following command:

ts-engine start --react

Bundling dependencies

The start command supports building the Node.js application and bundling its dependencies. See the build docs for more information.

You can bundle dependencies by running the following command:

ts-engine start --bundle-dependencies
note

The build will be identical to that produced by running yarn ts-engine build --node-app --bundle-dependencies.