NativeScript 6.0 is webpack-only! The NativeScript CLI now relies on webpack to build your application code.

Before

Before version 6.0, NativeScript supported two ways of building a project:

tns build - The Legacy Workflow, which copies the full content of the source code directory ("src/");

tns build --bundle - The Bundle Workflow, which relies on webpack to bundle the source code directory ("src/") into a few output files.

The bundle workflow was available behind the bundle flag. You could use it not only for building but also during development:

tns run --bundle tns preview --bundle tns debug --bundle tns test --bundle

The bundle workflow also supported hot module replacement with the hmr flag.

tns run --bundle --hmr

Webpack-only

Starting with version 6.0, the NativeScript CLI will support only the bundle workflow with webpack. The legacy workflow is no longer available. All CLI commands that build the application code now use the bundle workflow:

tns build tns run tns preview tns prepare tns debug tns test

The bundle flag

You can still provide the bundle flag to any of the above commands. It won't change their behavior in any way. However, you can't switch off the bundle flag and you can't disable the bundle workflow.

The sync-all-files flag The sync-all-files flag is no longer available. Providing it used to enable watching the node_modules directory for changes and syncing it during development. With the bundle workflow, this is automatically taken care of. The workflow of watching files is:

Webpack watches all files that have been required in the source code regardless of their location (app or node_modules); The NativeScript CLI starts its own watch for the native files: files from App_Resources

platforms directories of nativescript plugins

package.json files of nativescript plugins The NativeScript CLI also watches the application package.json files ( my-project/package.json and my-project/app/package-json ). Hot Module Replacement by default