Function construct

  • constructs a SGRUD-based project using microbundle.

    Description
      Constructs a SGRUD-based project using `microbundle`
    
    Usage
      $ sgrud construct [...modules] [options]
    
    Options
      --compress    Compress/minify build output  (default true)
      --format      Build specified formats  (default commonjs,modern,umd)
      --prefix      Use an alternative working directory  (default ./)
      -h, --help    Displays this message
    
    Examples
      $ sgrud construct # Run with default options
      $ sgrud construct ./project/module # Build ./project/module
      $ sgrud construct ./module --format umd # Build ./module as umd
    

    Parameters

    • options: {
          compress?: boolean;
          format?: string;
          modules?: string[];
          prefix?: string;
      } = {}

      The options object.

      • Optional compress?: boolean

        Compress/minify construct output.

        Default Value

        true

      • Optional format?: string

        construct specified formats.

        Default Value

        'commonjs,modern,umd'

      • Optional modules?: string[]

        Modules to construct.

        Default Value

        package.json#sgrud.construct

      • Optional prefix?: string

        Use an alternative working directory.

        Default Value

        './'

    Returns Promise<void>

    An execution Promise.

    Example

    Run with default options:

    require('@sgrud/bin');

    sgrud.bin.construct();

    Example

    construct ./project/module:

    require('@sgrud/bin');

    sgrud.bin.construct({
    modules: ['./project/module']
    });

    Example

    construct ./module as umd:

    require('@sgrud/bin');

    sgrud.bin.construct({
    modules: ['./module'],
    format: 'umd'
    });

Generated using TypeDoc