vovk 0.2.3-beta.101 → 0.2.3-beta.103

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.
Files changed (2) hide show
  1. package/cli/getVars.js +8 -1
  2. package/package.json +1 -1
package/cli/getVars.js CHANGED
@@ -1,6 +1,12 @@
1
1
  // @ts-check
2
2
  const path = require('path');
3
3
 
4
+ /** @type {(modulePath: string) => any} */
5
+ function requireFresh(modulePath) {
6
+ delete require.cache[require.resolve(modulePath)];
7
+ return require(modulePath);
8
+ }
9
+
4
10
  /** @type {import('../src').VovkEnv} */
5
11
  /** @type {(rcPath: string, options?: { VOVK_CLIENT_OUT?: string; }) => import('../src').VovkEnv} */
6
12
  function getVars(configPath, options = {}) {
@@ -14,12 +20,13 @@ function getVars(configPath, options = {}) {
14
20
  };
15
21
 
16
22
  try {
17
- Object.assign(vovkConfig, require(configPath));
23
+ Object.assign(vovkConfig, requireFresh(configPath));
18
24
  } catch {
19
25
  // noop
20
26
  }
21
27
 
22
28
  const vars = {
29
+ PORT: process.env.PORT || '3000',
23
30
  VOVK_CLIENT_OUT:
24
31
  process.env.VOVK_CLIENT_OUT ||
25
32
  (options.VOVK_CLIENT_OUT?.startsWith('/')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vovk",
3
- "version": "0.2.3-beta.101",
3
+ "version": "0.2.3-beta.103",
4
4
  "description": "Structural add-on for Next.js",
5
5
  "bin": "./cli/index.js",
6
6
  "scripts": {