UNPKG

@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)

24 lines 1.25 kB
import { __awaiter } from "tslib"; export function BeforeOfflineStartInit() { return __awaiter(this, void 0, void 0, function* () { var _a; this.log.verbose('[sls-rspack] before:offline:start:init'); this.offlineMode = true; this.pluginOptions = Object.assign(Object.assign({}, this.pluginOptions), { sourcemap: 'source-map' }); yield this.bundle(this.functionEntries); yield this.scripts(); if ((_a = this.serverless.service.custom) === null || _a === void 0 ? void 0 : _a['serverless-offline']) { this.serverless.service.custom['serverless-offline'].location = this.buildOutputFolderPath; } else { this.serverless.service.custom = Object.assign(Object.assign({}, this.serverless.service.custom), { 'serverless-offline': { location: this.buildOutputFolderPath } }); } this.serverless.service.getAllFunctions().forEach((functionName) => { const functionDefinitionHandler = this.serverless.service.getFunction(functionName); functionDefinitionHandler.handler = functionName + '/' + functionDefinitionHandler.handler; }); }); } //# sourceMappingURL=start-init.js.map