How to use the broccoli/dist/messages.onBuildSuccess function in broccoli

To help you get started, we’ve selected a few broccoli examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cliqz-oss / browser-core / fern / commands / build.js View on Github external
console.log('Starting build');
      const version = await getExtensionVersion(options.version);
      process.env.PACKAGE_VERSION = version;
      process.env.EXTENSION_VERSION = version;

      if (!process.env.VERSION) {
        process.env.VERSION = version;
      }

      const builder = getBroccoliBuilder(OUTPUT_PATH);

      try {
        await builder.build();
        syncBuildFolder(builder, OUTPUT_PATH);
        onBuildSuccess(builder, new UI()); // display slow-trees
      } catch (ex) {
        console.error(ex);
        process.exit(1);
      } finally {
        await builder.cleanup();
      }

      // It seems that on fresh builds, process hangs here. Looking at upstream
      // source-code of broccoli project, they also explicitely call
      // `process.exit(0)` at the end of build. It would be nice to know why
      // this is needed though.
      process.exit(0);
    });
};