Skip to content

Bagaar/build-helpers

Repository files navigation

@bagaar/build-helpers

CI Code Style: Prettier Conventional Commits

Build helpers for Bagaar apps.

Usage

  1. Include the build info in the app:
// config/environment.js

const { getBuildInfo } = require("@bagaar/build-helpers");

module.exports = function () {
  const ENV = {
    buildInfo: getBuildInfo(),
  };

  return ENV;
};
  1. Pass along the build version to Bugsnag:
// app/routes/application.js

import Bugsnag from "@bugsnag/js";
import Route from "@ember/routing/route";
import config from "ember-project-boilerplate/config/environment";

export default class ApplicationRoute extends Route {
  beforeModel() {
    this.setupBugsnag();
  }

  setupBugsnag() {
    Bugsnag.start({
      appVersion: config.buildInfo.versionWithHash,
    });
  }
}
  1. Build the app:
pnpm build
  1. Upload the source maps to Bugsnag:
pnpm upload-source-maps
  1. Clean the "dist" folder:
pnpm clean-dist-folder
  1. Finally, upload the "dist" folder to the server.