@nikovirtala/projen-constructs
    Preparing search index...

    Interface BundlingOptions

    Options for bundling.

    interface BundlingOptions {
        banner?: string;
        externals?: string[];
        format?: string;
        loaders?: { [key: string]: string };
        mainFields?: string;
        minify?: boolean;
        outfile?: string;
        platform?: string;
        sourcemap?: boolean;
        sourcesContent?: boolean;
        target?: string;
        tsconfigPath?: string;
    }
    Index
    banner?: string

    esbuild --banner argument, appended as is (so it starts with the file type, e.g. :js=).

    The default defines require so that CommonJS dependencies work in an ES module bundle.

    ":js=import { createRequire as topLevelCreateRequire } from 'module';const require = topLevelCreateRequire(import.meta.url)"
    
    externals?: string[]

    You can mark a file or a package as external to exclude it from your build. Instead of being bundled, the import will be preserved (using require for the iife and cjs formats and using import for the esm format) and will be evaluated at run time instead.

    This has several uses. First of all, it can be used to trim unnecessary code from your bundle for a code path that you know will never be executed. For example, a package may contain code that only runs in node but you will only be using that package in the browser. It can also be used to import code in node at run time from a package that cannot be bundled. For example, the fsevents package contains a native extension, which esbuild doesn't support.

    []
    
    format?: string

    Output format for the generated JavaScript files: "iife", "cjs" or "esm".

    loaders?: { [key: string]: string }

    Map of file extensions (without dot) and loaders to use for this file type. Loaders are appended to the esbuild command by --loader:.extension=loader

    • the loaders of the Bundler
    mainFields?: string

    Comma-separated list of package.json fields esbuild tries when resolving a package.

    "module,main"
    
    minify?: boolean

    Minify the bundle.

    outfile?: string

    Bundler output path relative to the asset's output directory.

    "index.mjs"
    
    platform?: string

    esbuild platform.

    "node"
    
    sourcemap?: boolean

    Include a source map in the bundle.

    true
    
    sourcesContent?: boolean

    Include the original source code in the source map.

    target?: string

    esbuild target.

    "esnext"
    
    tsconfigPath?: string

    The path of the tsconfig.json file to use for bundling.

    LambdaFunctionCodeBundle always sets this to the project's development tsconfig.

    - no tsconfig is passed to esbuild