From 6473f00f966272576046ed5038c81e26d3e03f91 Mon Sep 17 00:00:00 2001 From: indy koning Date: Tue, 29 Aug 2023 14:57:16 +0200 Subject: [PATCH] Revert "Workaround for Vite bug watching every page if you use negated patterns (#52)" This reverts commit afb84333b6fdb90f81680b2fc4be85de45a30fb5. --- resources/js/components.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/js/components.js b/resources/js/components.js index 01ade72..5663732 100644 --- a/resources/js/components.js +++ b/resources/js/components.js @@ -1,7 +1,7 @@ (() => { const components = { - // Eager load all components not containing an extra . in the name - ...import.meta.glob(['./components/**/*([^\.]).vue'], { eager: true, import: 'default' }), + // Eager load all components not ending with .lazy.vue + ...import.meta.glob(['./components/**/*.vue', '!./components/**/*.lazy.vue'], { eager: true, import: 'default' }), // Lazy load all components not ending with .lazy.vue ...import.meta.glob(['./components/**/*.lazy.vue'], { eager: false, import: 'default' }) }; @@ -10,7 +10,7 @@ .split('/').pop() // Remove directories .split('.').shift() // Remove extension .replace(/^.|[A-Z]/g, letter => `-${letter.toLowerCase()}`) // PascalCase to snake_case - .substr(1) // Remove the starting dash + .substring(1) // Remove the starting dash // Register component using their filename. Vue.component(componentName, components[path])