TypeDoc API
    Preparing search index...

    Function file

    • Loads a file and returns its content as JavaScript code. If the file is a TypeScript file, it will be bundled using esbuild.

      Parameters

      • filePath: string

        The path to the file to load.

      • OptionalcompilerOptions: BuildOptions

        Optional esbuild build options to customize the bundling process.

      Returns Promise<{ jsCode: string }>

      An object containing the JavaScript code as a string.

      Will throw an error if the file cannot be read or bundled.