• English
  • build

    The rs build command uses Rsbuild to build an application for production.

    Usage

    rs build [options]

    The command loads the application configuration registered with define.app().

    Options

    rs build supports the same build options as Rsbuild. See the Rsbuild CLI documentation for details.

    Examples:

    # Write output files to the output directory
    rs build --dist-path output
    
    # Generate source maps for the output files
    rs build --source-map
    
    # Rebuild when files change
    rs build --watch

    Configuration

    Configure the production build through define.app() in the Rstack configuration file. It accepts the standard Rsbuild configuration:

    rstack.config.ts
    import { define } from 'rstack';
    
    define.app({
      output: {
        distPath: {
          root: 'output',
        },
        sourceMap: true,
      },
    });