NOTE
StrongLoop Arc and slc are no longer under active development, and will soon be deprecated. Arc's features are being included in the IBM API Connect Developer Toolkit: Please use it instead.
Skip to end of metadata
Go to start of metadata

Building applications:

  1. Install dependencies
  2. Bundle dependencies
  3. Create deploy package, either:

If your application has a node_modules folder (created, for example, when you run npm install for the application), then slc build will "bundle" (include in the deployment package) the dependencies. if the application does not have a node_modules folder, then it does not bundle dependencies.



Icon

You can also use the npm pack command directly.  This command creates a .tgz file that you can then deploy to StrongLoop Process Manager with slc deploy (or indeed, to publish to npmjs.org).


Non-public Information

 Configuring bundle dependencies

You must list all non-development dependencies, including optional dependencies, in the bundleDependencies property in package.json.

Icon

Remember to add every new production dependency to the bundleDependencies property.  If you don't, npm will try to install them after deployment, creating unexpected and fragile dependencies on npmjs.org.

Keeping this list up to date manually is error-prone, so it's better to let the slc build --bundle command to do it for you. However, slc build does not modify the bundleDependencies property if it is present, so you are free to maintain it yourself, if you wish (or to not use the bundle command).

Using a .npmignore file

Use the .npmignore configuration file, file to exclude files from the build package, such as build output and project ephemera such as test output.  If npm does not find an .npmignore file, it uses .gitignore as a fallback.  This means that if you have custom build output, such as minimized JavaScript, it will be treated as project ephemera, and not be packed by npm.

The bundle command will create an empty .npmignore file if there is a .gitignore file but there is not .npmignore file. This will work for clean repositories, but if you have any project ephemera, they will get packed.

Icon

Write and maintain you own .npmignore file unless your build process guarantees a clean working repository.

Next:

Create deploy package, either:

  • No labels