@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)
23 lines • 1.01 kB
JavaScript
import { __awaiter } from "tslib";
import { isDeployFunctionOptions } from '../../types.js';
export function BeforeDeployFunctionPackageFunction() {
return __awaiter(this, void 0, void 0, function* () {
this.log.verbose('[sls-rspack] before:deploy:function:packageFunction');
if (!isDeployFunctionOptions(this.options)) {
throw new this.serverless.classes.Error('This hook only supports deploy function options');
}
const deployFunc = this.options.function;
if (!(deployFunc in this.functionEntries)) {
throw new this.serverless.classes.Error(`Function ${deployFunc} not found in function entries`);
}
const entry = this.functionEntries[deployFunc];
yield this.bundle({
[deployFunc]: entry,
});
this.functionEntries = {};
this.functionEntries[deployFunc] = entry;
yield this.scripts();
yield this.pack();
});
}
//# sourceMappingURL=before-package-function.js.map