@vercel/node 2.5.15 → 2.5.17
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.js +11 -2
- package/package.json +3 -3
package/dist/dev-server.js
CHANGED
@@ -71,6 +71,11 @@ const ts_morph_1 = require("ts-morph");
|
|
71
71
|
const esbuild_1 = __importDefault(require("esbuild"));
|
72
72
|
const node_fetch_1 = __importDefault(require("node-fetch"));
|
73
73
|
const edge_wasm_plugin_1 = require("./edge-wasm-plugin");
|
74
|
+
const NODE_VERSION_MAJOR = process.version.match(/^v(\d+)\.\d+/)?.[1];
|
75
|
+
const NODE_VERSION_IDENTIFIER = `node${NODE_VERSION_MAJOR}`;
|
76
|
+
if (!NODE_VERSION_MAJOR) {
|
77
|
+
throw new Error(`Unable to determine current node version: process.version=${process.version}`);
|
78
|
+
}
|
74
79
|
function logError(error) {
|
75
80
|
console.error(error.message);
|
76
81
|
if (error.stack) {
|
@@ -130,8 +135,12 @@ async function compileUserCode(entrypointPath, entrypointLabel, isMiddleware) {
|
|
130
135
|
const { wasmAssets, plugin: edgeWasmPlugin } = edge_wasm_plugin_1.createEdgeWasmPlugin();
|
131
136
|
try {
|
132
137
|
const result = await esbuild_1.default.build({
|
133
|
-
|
134
|
-
|
138
|
+
// bundling behavior: use globals (like "browser") instead
|
139
|
+
// of "require" statements for core libraries (like "node")
|
140
|
+
platform: 'browser',
|
141
|
+
// target syntax: only use syntax available on the current
|
142
|
+
// version of node
|
143
|
+
target: NODE_VERSION_IDENTIFIER,
|
135
144
|
sourcemap: 'inline',
|
136
145
|
bundle: true,
|
137
146
|
plugins: [edgeWasmPlugin],
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vercel/node",
|
3
|
-
"version": "2.5.
|
3
|
+
"version": "2.5.17",
|
4
4
|
"license": "MIT",
|
5
5
|
"main": "./dist/index",
|
6
6
|
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
|
@@ -31,7 +31,7 @@
|
|
31
31
|
"dependencies": {
|
32
32
|
"@edge-runtime/vm": "1.1.0-beta.32",
|
33
33
|
"@types/node": "*",
|
34
|
-
"@vercel/build-utils": "5.4.
|
34
|
+
"@vercel/build-utils": "5.4.4",
|
35
35
|
"@vercel/node-bridge": "3.0.0",
|
36
36
|
"@vercel/static-config": "2.0.3",
|
37
37
|
"edge-runtime": "1.1.0-beta.32",
|
@@ -61,5 +61,5 @@
|
|
61
61
|
"source-map-support": "0.5.12",
|
62
62
|
"test-listen": "1.1.0"
|
63
63
|
},
|
64
|
-
"gitHead": "
|
64
|
+
"gitHead": "51d968314f5914138defa2a9fe724324d53efdd1"
|
65
65
|
}
|