@vercel/express 0.0.19 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +14 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -681,7 +681,9 @@ var invokeFunction = async (args, options) => {
|
|
|
681
681
|
});
|
|
682
682
|
};
|
|
683
683
|
var expressShimSource = (args) => {
|
|
684
|
-
const pathToExpress = require_3.resolve("express"
|
|
684
|
+
const pathToExpress = require_3.resolve("express", {
|
|
685
|
+
paths: [args.outputDir]
|
|
686
|
+
});
|
|
685
687
|
const introspectionPath = getIntrospectionPath(args);
|
|
686
688
|
return `
|
|
687
689
|
const fs = require('fs');
|
|
@@ -721,10 +723,11 @@ const extractRoutes = () => {
|
|
|
721
723
|
routesExtracted = true;
|
|
722
724
|
|
|
723
725
|
const methods = ["all", "get", "post", "put", "delete", "patch", "options", "head"]
|
|
724
|
-
if (!app
|
|
726
|
+
if (!app) {
|
|
725
727
|
return;
|
|
726
728
|
}
|
|
727
|
-
|
|
729
|
+
const router = app._router || app.router
|
|
730
|
+
for (const route of router.stack) {
|
|
728
731
|
if(route.route) {
|
|
729
732
|
const m = [];
|
|
730
733
|
for (const method of methods) {
|
|
@@ -806,9 +809,15 @@ var build2 = async (args) => {
|
|
|
806
809
|
args.entrypoint = await entrypointCallback2(args);
|
|
807
810
|
const rolldownResult = await rolldown(args);
|
|
808
811
|
const { routes } = await introspectApp(args, rolldownResult);
|
|
809
|
-
const lambda = new import_build_utils6.
|
|
812
|
+
const lambda = new import_build_utils6.NodejsLambda({
|
|
810
813
|
runtime: downloadResult.nodeVersion.runtime,
|
|
811
|
-
...rolldownResult
|
|
814
|
+
...rolldownResult,
|
|
815
|
+
shouldAddHelpers: false,
|
|
816
|
+
shouldAddSourcemapSupport: true,
|
|
817
|
+
framework: {
|
|
818
|
+
slug: "express"
|
|
819
|
+
},
|
|
820
|
+
awsLambdaHandler: ""
|
|
812
821
|
});
|
|
813
822
|
const output = { index: lambda };
|
|
814
823
|
for (const route of routes) {
|