@vercel/node 5.3.10 → 5.3.11
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/dev-server.mjs +10 -1
- package/dist/index.js +5 -1
- package/package.json +1 -1
package/dist/dev-server.mjs
CHANGED
|
@@ -1116,7 +1116,7 @@ async function compileUserCode2(entrypointPath, awaiter, options) {
|
|
|
1116
1116
|
if (listener.default)
|
|
1117
1117
|
listener = listener.default;
|
|
1118
1118
|
}
|
|
1119
|
-
const shouldUseWebHandlers = options.isMiddleware || HTTP_METHODS.some((method) => typeof listener[method] === "function");
|
|
1119
|
+
const shouldUseWebHandlers = options.isMiddleware || HTTP_METHODS.some((method) => typeof listener[method] === "function") || typeof listener.fetch === "function";
|
|
1120
1120
|
if (shouldUseWebHandlers) {
|
|
1121
1121
|
const { createWebExportsHandler: createWebExportsHandler2 } = await Promise.resolve().then(() => (init_helpers_web(), helpers_web_exports));
|
|
1122
1122
|
const getWebExportsHandler = createWebExportsHandler2(awaiter);
|
|
@@ -1130,6 +1130,15 @@ async function compileUserCode2(entrypointPath, awaiter, options) {
|
|
|
1130
1130
|
{}
|
|
1131
1131
|
);
|
|
1132
1132
|
}
|
|
1133
|
+
if (typeof listener.fetch === "function") {
|
|
1134
|
+
handler = HTTP_METHODS.reduce(
|
|
1135
|
+
(acc, method) => {
|
|
1136
|
+
acc[method] = listener.fetch;
|
|
1137
|
+
return acc;
|
|
1138
|
+
},
|
|
1139
|
+
{}
|
|
1140
|
+
);
|
|
1141
|
+
}
|
|
1133
1142
|
return getWebExportsHandler(handler, HTTP_METHODS);
|
|
1134
1143
|
}
|
|
1135
1144
|
return async (req, res) => {
|
package/dist/index.js
CHANGED
|
@@ -69526,7 +69526,11 @@ function register(opts = {}) {
|
|
|
69526
69526
|
const output = service.getEmitOutput(fileName);
|
|
69527
69527
|
const diagnostics = service.getSemanticDiagnostics(fileName).concat(service.getSyntacticDiagnostics(fileName));
|
|
69528
69528
|
const diagnosticList = filterDiagnostics(diagnostics, ignoreDiagnostics);
|
|
69529
|
-
|
|
69529
|
+
if (process.env.EXPERIMENTAL_NODE_TYPESCRIPT_ERRORS) {
|
|
69530
|
+
reportTSError(diagnosticList, true);
|
|
69531
|
+
} else {
|
|
69532
|
+
reportTSError(diagnosticList, config.options.noEmitOnError);
|
|
69533
|
+
}
|
|
69530
69534
|
if (output.emitSkipped) {
|
|
69531
69535
|
throw new TypeError(`${(0, import_path.relative)(cwd, fileName)}: Emit skipped`);
|
|
69532
69536
|
}
|