CI/CD Tutorial

In CI/CD, there is often a desire to upload historical reports to the CDN as historical records. Because it's not convenient to achieve instant use in the standard mode, the Brief mode is supported.

Brief Mode

In Brief mode, data reports are integrated into a single HTML page, making it easy for users to view historical build data in a summary form within CI/CD and other scenarios.

Enabling Brief Mode

Version: 0.4.0

You can enable Brief mode by configuring the mode.brief option in the Rsdoctor plugin. After the build, Brief mode will generate a report in the build output directory: [outputDir]/.rsdoctor/report-rsdoctor.html. You can view the build analysis summary by opening the HTML file in a browser.

  • In Brief mode, no code data is displayed to prevent the page from crashing due to large data sizes.
  • The report output directory and file name can be configured. Refer to: Options.
  • For more configurations, refer to: Options.
rspack.config.js
const { RsdoctorRspackPlugin } = require('@rsdoctor/rspack-plugin');

module.exports = {
  // ...
  plugins: [
    process.env.RSDOCTOR &&
      new RsdoctorRspackPlugin({
        // other options
        mode: 'brief',
      }),
  ].filter(Boolean),
};

Differences between Brief Mode and Lite Mode

Currently, Rsdoctor has several report modes: Normal, Brief, and Lite.

  • normal mode: Generates a .rsdoctor folder in the build output directory, which contains various data files and displays code in the report page. The output directory can be configured via reportDir.

  • brief mode: Generates an HTML report file in the .rsdoctor folder within the build output directory. All build analysis data will be consolidated into this HTML file, which can be viewed by opening it in a browser. Brief mode also has additional configuration options, detailed at: brief.

  • lite mode: Based on the normal mode, this mode does not display source code and product code, only showing the information of the bundled code.