vike 0.4.252-commit-e3a6e9d → 0.4.252-commit-3ea247f

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.
@@ -17,7 +17,7 @@ const globalObject = getGlobalObject('vite/shared/loggerDev.ts', {
17
17
  processStartupLog_hasViteLoggedStartup: null,
18
18
  processStartupLog_hasViteLoggedHelpShortcut: null,
19
19
  swallowViteLogForceOptimization_enabled: false,
20
- swallowViteLogConnected_originalConsoleLog: null,
20
+ swallowViteLogConnected_originalConsoleLog: undefined,
21
21
  });
22
22
  function interceptViteLogs(config) {
23
23
  if (isDebugError())
@@ -123,22 +123,29 @@ function swallowViteLogForceOptimization_enable() {
123
123
  function swallowViteLogForceOptimization_disable() {
124
124
  globalObject.swallowViteLogForceOptimization_enabled = false;
125
125
  }
126
- // Suppress "[vite] connected." message. (It doesn't go through Vite's logger thus we must monkey patch the console.log() function.)
126
+ // Swallow message `[vite] connected.`
127
127
  function swallowViteLogConnected() {
128
128
  if (isDebugError())
129
129
  return;
130
130
  if (globalObject.swallowViteLogConnected_originalConsoleLog)
131
131
  return;
132
132
  globalObject.swallowViteLogConnected_originalConsoleLog = console.log;
133
+ // The message `[vite] connected.` doesn't go through Vite's logger thus we must monkey patch console.log()
133
134
  console.log = swallowViteLogConnected_logPatch;
134
135
  setTimeout(swallowViteLogConnected_clean, 3000);
135
136
  }
136
137
  // Remove console.log() monkey patch
137
138
  function swallowViteLogConnected_clean() {
138
- // Don't remove console.log() patches from other libraries (e.g. instrumentation)
139
- if (console.log === swallowViteLogConnected_logPatch)
139
+ if (isDebugError()) {
140
+ assert(globalObject.swallowViteLogConnected_originalConsoleLog === undefined);
140
141
  return;
142
+ }
143
+ if (globalObject.swallowViteLogConnected_originalConsoleLog === null)
144
+ return; // already cleaned
141
145
  assert(globalObject.swallowViteLogConnected_originalConsoleLog);
146
+ // Don't remove console.log() patches from other libraries (e.g. instrumentation)
147
+ if (console.log !== swallowViteLogConnected_logPatch)
148
+ return;
142
149
  console.log = globalObject.swallowViteLogConnected_originalConsoleLog;
143
150
  globalObject.swallowViteLogConnected_originalConsoleLog = null;
144
151
  }
@@ -1 +1 @@
1
- export declare const PROJECT_VERSION: "0.4.252-commit-e3a6e9d";
1
+ export declare const PROJECT_VERSION: "0.4.252-commit-3ea247f";
@@ -1,2 +1,2 @@
1
1
  // Automatically updated by @brillout/release-me
2
- export const PROJECT_VERSION = '0.4.252-commit-e3a6e9d';
2
+ export const PROJECT_VERSION = '0.4.252-commit-3ea247f';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike",
3
- "version": "0.4.252-commit-e3a6e9d",
3
+ "version": "0.4.252-commit-3ea247f",
4
4
  "repository": "https://github.com/vikejs/vike",
5
5
  "exports": {
6
6
  "./server": {