Skip to content

Commit 04e09a2

Browse files
committed
fix: prevent ReferenceError in browser (process guard for Vite) + update gitignore
1 parent f74ced7 commit 04e09a2

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
node_modules
22
dist
33
.DS_Store
4+
5+
# IDE
6+
.idea/
7+
*.iml

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
* Ensures that Vuex actions within the same module (namespace) run sequentially
77
* (no parallel execution within a module) and deduplicates duplicate dispatches
88
* (in-flight + quick-repeat).
9-
*
10-
* @version 1.0.0
11-
* @date 2025-09-03
129
*/
1310

1411
import type {DispatchOptions, Plugin, Store} from 'vuex'
@@ -448,7 +445,8 @@ function cancelHealthReport() {
448445
* * - In the dedicated plugin tests we stub `VITEST=''` to force the plugin on.
449446
*/
450447
export function createVuexMutexPlugin(mutexPluginOptions: MutexPluginOptions = {}): Plugin<any> {
451-
if (process?.env?.VITEST) {
448+
const IS_VITEST = typeof process !== 'undefined' && !!process.env?.VITEST
449+
if (IS_VITEST) {
452450
return () => {}
453451
}
454452

0 commit comments

Comments
 (0)