@kitchenshelf/serverless-rspack
Version:
[Serverless Framework](https://www.serverless.com) plugin for zero-config JavaScript and TypeScript code bundling using the high performance Rust-based JavaScript bundler [`rspack`](https://rspack.dev/guide/start/introduction)
53 lines (52 loc) • 2.9 kB
TypeScript
import { RspackOptions } from '@rspack/core';
import type Serverless from 'serverless';
import type ServerlessPlugin from 'serverless/classes/Plugin';
import { PluginFunctionEntries, PluginFunctionScripts, PluginOptions } from './types.js';
export declare class RspackServerlessPlugin implements ServerlessPlugin {
serviceDirPath: string;
buildOutputFolder: string;
buildOutputFolderPath: string;
packageOutputFolder: string;
log: ServerlessPlugin.Logging['log'];
serverless: Serverless;
options: Serverless.Options;
hooks: ServerlessPlugin.Hooks;
providedRspackConfig: RspackOptions | undefined;
pluginOptions: PluginOptions;
functionEntries: PluginFunctionEntries;
functionScripts: PluginFunctionScripts;
offlineMode: boolean;
timings: Map<string, number>;
protected bundle: (entries: import("@rspack/core").Entry | undefined) => Promise<unknown>;
protected pack: () => Promise<void>;
protected scripts: () => Promise<void>;
constructor(serverless: Serverless, options: Serverless.Options, logging: ServerlessPlugin.Logging);
protected buildFunctionEntries(functions: string[]): PluginFunctionEntries;
protected buildFunctionScripts(functions: string[]): PluginFunctionScripts;
protected cleanup(): Promise<void>;
protected getPluginOptions(): {
keepOutputDirectory: boolean;
zipConcurrency: number;
stats: boolean;
esm: boolean;
mode: "production" | "development" | "none";
doctor?: boolean | {
enable: boolean;
outputDirectory?: string | null | undefined;
} | null | undefined;
config?: {
path: string;
strategy: "override" | "combine";
} | null | undefined;
scripts?: string[] | null | undefined;
sourcemap?: false | "eval" | "cheap-source-map" | "cheap-module-source-map" | "source-map" | "inline-cheap-source-map" | "inline-cheap-module-source-map" | "inline-source-map" | "inline-nosources-cheap-source-map" | "inline-nosources-cheap-module-source-map" | "inline-nosources-source-map" | "nosources-cheap-source-map" | "nosources-cheap-module-source-map" | "nosources-source-map" | "hidden-nosources-cheap-source-map" | "hidden-nosources-cheap-module-source-map" | "hidden-nosources-source-map" | "hidden-cheap-source-map" | "hidden-cheap-module-source-map" | "hidden-source-map" | "eval-cheap-source-map" | "eval-cheap-module-source-map" | "eval-source-map" | "eval-nosources-cheap-source-map" | "eval-nosources-cheap-module-source-map" | "eval-nosources-source-map" | undefined;
tsConfig?: string | null | undefined;
externals?: string[] | null | undefined;
};
private isEnabledNodeFunction;
private isDisabledViaRspack;
private isEnabledViaRspack;
private getEntryForFunction;
private getHandlerFile;
private isESM;
}