@netlify/dev 4.3.7 → 4.3.8
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/main.cjs +21 -8
- package/dist/main.js +21 -8
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -295,6 +295,7 @@ var getRuntime = async ({ blobs, deployID, projectRoot, siteID }) => {
|
|
|
295
295
|
});
|
|
296
296
|
return {
|
|
297
297
|
env,
|
|
298
|
+
envSnapshot,
|
|
298
299
|
stop: async () => {
|
|
299
300
|
restoreEnvironment(envSnapshot);
|
|
300
301
|
await blobsServer?.stop();
|
|
@@ -543,19 +544,31 @@ var NetlifyDev = class {
|
|
|
543
544
|
});
|
|
544
545
|
}
|
|
545
546
|
if (this.#features.edgeFunctions) {
|
|
546
|
-
const
|
|
547
|
-
|
|
548
|
-
|
|
547
|
+
const edgeFunctionsEnv = {
|
|
548
|
+
// User-defined env vars + documented runtime env vars
|
|
549
|
+
...Object.entries(envVariables).reduce(
|
|
550
|
+
(acc, [key, variable]) => ({
|
|
549
551
|
...acc,
|
|
550
552
|
[key]: variable.value
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
553
|
+
}),
|
|
554
|
+
{}
|
|
555
|
+
),
|
|
556
|
+
// Add runtime env vars that we've set ourselves so far. These are "internal" env vars,
|
|
557
|
+
// part of the runtime emulation. They've already been populated on this process's env, which
|
|
558
|
+
// is needed to make other dev features work. These are different than the "documented" runtime
|
|
559
|
+
// env vars, in that they are implementation details, needed to make our features work.
|
|
560
|
+
...Object.keys(runtime.envSnapshot).reduce(
|
|
561
|
+
(acc, key) => ({
|
|
562
|
+
...acc,
|
|
563
|
+
[key]: runtime.env.get(key) ?? ""
|
|
564
|
+
}),
|
|
565
|
+
{}
|
|
566
|
+
)
|
|
567
|
+
};
|
|
555
568
|
const edgeFunctionsHandler = new import_dev.EdgeFunctionsHandler({
|
|
556
569
|
configDeclarations: this.#config?.config.edge_functions ?? [],
|
|
557
570
|
directories: [this.#config?.config.build.edge_functions].filter(Boolean),
|
|
558
|
-
env,
|
|
571
|
+
env: edgeFunctionsEnv,
|
|
559
572
|
geolocation: import_dev_utils.mockLocation,
|
|
560
573
|
logger: this.#logger,
|
|
561
574
|
siteID,
|
package/dist/main.js
CHANGED
|
@@ -261,6 +261,7 @@ var getRuntime = async ({ blobs, deployID, projectRoot, siteID }) => {
|
|
|
261
261
|
});
|
|
262
262
|
return {
|
|
263
263
|
env,
|
|
264
|
+
envSnapshot,
|
|
264
265
|
stop: async () => {
|
|
265
266
|
restoreEnvironment(envSnapshot);
|
|
266
267
|
await blobsServer?.stop();
|
|
@@ -509,19 +510,31 @@ var NetlifyDev = class {
|
|
|
509
510
|
});
|
|
510
511
|
}
|
|
511
512
|
if (this.#features.edgeFunctions) {
|
|
512
|
-
const
|
|
513
|
-
|
|
514
|
-
|
|
513
|
+
const edgeFunctionsEnv = {
|
|
514
|
+
// User-defined env vars + documented runtime env vars
|
|
515
|
+
...Object.entries(envVariables).reduce(
|
|
516
|
+
(acc, [key, variable]) => ({
|
|
515
517
|
...acc,
|
|
516
518
|
[key]: variable.value
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
519
|
+
}),
|
|
520
|
+
{}
|
|
521
|
+
),
|
|
522
|
+
// Add runtime env vars that we've set ourselves so far. These are "internal" env vars,
|
|
523
|
+
// part of the runtime emulation. They've already been populated on this process's env, which
|
|
524
|
+
// is needed to make other dev features work. These are different than the "documented" runtime
|
|
525
|
+
// env vars, in that they are implementation details, needed to make our features work.
|
|
526
|
+
...Object.keys(runtime.envSnapshot).reduce(
|
|
527
|
+
(acc, key) => ({
|
|
528
|
+
...acc,
|
|
529
|
+
[key]: runtime.env.get(key) ?? ""
|
|
530
|
+
}),
|
|
531
|
+
{}
|
|
532
|
+
)
|
|
533
|
+
};
|
|
521
534
|
const edgeFunctionsHandler = new EdgeFunctionsHandler({
|
|
522
535
|
configDeclarations: this.#config?.config.edge_functions ?? [],
|
|
523
536
|
directories: [this.#config?.config.build.edge_functions].filter(Boolean),
|
|
524
|
-
env,
|
|
537
|
+
env: edgeFunctionsEnv,
|
|
525
538
|
geolocation: mockLocation,
|
|
526
539
|
logger: this.#logger,
|
|
527
540
|
siteID,
|