Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Step 2: Configure upload of sourcemaps to your Kloudfuse installation

TBDWhen building your app for production, you’ll need to generate sourcemaps. This can typically be configured as part of the builder you’re using.

Kloudfuse provides a command line tool to upload your sourcemaps. It’s available as an NPM package and can be installed as follows:

Code Block
$ npm install -D kf-cli

After building your sourcemaps, you can use kf-cli from your npm project like so:

Code Block
$ npx KF_API_KEY=<KF_API_KEY> kf-cli sourcemaps upload \
  --release-version <RELEASE_VERSION> \
  --service <SERVICE> \
  --minified-path-prefix <MINIFIED_PATH_PREFIX> \
  --baseUrl <KF_CLUSTER_URL> \
  <BUILD_DIRECTORY>
  • KF_API_KEY: an authorization key to identify users with access to the source map upload endpoint. This should be passed as an environment variable

  • --release-version: a string representing the unique frontend application build (e.g. 1.0.0)

  • --service: a friendly name unique to the the frontend application being instrumented

  • --minified-path-prefix: This is the pathname of your deployed build directory. For example, if your application is served at http://myapp.com/app, this value would /app. If your web application is served at the root hostname http://myapp.com, this value would be /.

  • --baseUrl: is the hostname of your Kloudfuse cluster

  • BUILD_DIRECTORY: the last argument is your build directory. I.E. build, out, dist

Example

Code Block
$ npx KF_API_KEY=80a2eb62-9b59-4519-9807-d2f4714cbc3c  kf-cli sourcemaps upload \
  --release-version 1.0.1 \
  --service my-web-app \
  --minified-path-prefix \app \
  --baseUrl https://kf.myapp.com \
  ./build