NPM Build Utilities @ 0.2.0-alpha.1
    Preparing search index...

    Interface Compiler

    Shape of the utility class for compiling file types.

    0.1.0-alpha

    interface Compiler {
        args: Stage.Compiler.Args;
        ARGS_DEFAULT: Stage.Compiler.Args;
        tsConfig: TsConfig;
        postCSS(
            paths: { from: string; to?: string }[],
            level: number,
            postCssOpts?: PostCSS,
        ): Promise<void>;
        scss(
            input: string,
            output: string,
            level: number,
            sassOpts?: Sass,
        ): Promise<void>;
        typescript(
            tsconfig: string,
            level: number,
            errorIfNotFound?: boolean,
        ): Promise<void>;
    }

    Implemented by

    Index

    Properties

    A completed args object.

    ARGS_DEFAULT: Stage.Compiler.Args

    Default values for the args property.

    tsConfig: TsConfig

    Default TS config file.

    Methods

    • Process css with the PostCSS npm package.

      Parameters

      • paths: { from: string; to?: string }[]

        Css paths to process (from), and optionally where to output them (to).

      • level: number

        Depth level for this message.

      • OptionalpostCssOpts: PostCSS

        Overrides for the configured PostCSS options in Stage.Compiler.args.

      Returns Promise<void>

      0.2.0-alpha

    • Compile scss using the sass npm package.

      Parameters

      • input: string

        Scss input path.

      • output: string

        Scss output path.

      • level: number

        Depth level for this message.

      • OptionalsassOpts: Sass

        Overrides for the configured sass options in Stage.Compiler.args.

      Returns Promise<void>

    • Compile typescript using the typescript npm package.

      Parameters

      • tsconfig: string

        Path to TS config json used to compile the project.

      • level: number

        Depth level for this message.

      • OptionalerrorIfNotFound: boolean

        Whether to throw error if the tsconfig file is not found.

      Returns Promise<void>

      StageError If the tsconfig file doesn’t exist.