Version: 1.5.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 build --node-app --minify

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.