diff --git a/packages/app-backend-vue3/src/components/util.ts b/packages/app-backend-vue3/src/components/util.ts
index 162724a54..06a8f144b 100644
--- a/packages/app-backend-vue3/src/components/util.ts
+++ b/packages/app-backend-vue3/src/components/util.ts
@@ -1,5 +1,4 @@
-import { classify } from '@vue-devtools/shared-utils'
-import { basename } from '../util'
+import { classify, basename } from '@vue-devtools/shared-utils'
import { ComponentInstance, App } from '@vue/devtools-api'
import { BackendContext } from '@vue-devtools/app-backend-api'
diff --git a/packages/app-backend-vue3/src/util.ts b/packages/app-backend-vue3/src/util.ts
index 1e8efa9f3..c03747cfc 100644
--- a/packages/app-backend-vue3/src/util.ts
+++ b/packages/app-backend-vue3/src/util.ts
@@ -9,15 +9,6 @@ export function flatten (items) {
}, [])
}
-// Use a custom basename functions instead of the shimed version
-// because it doesn't work on Windows
-export function basename (filename, ext) {
- return path.basename(
- filename.replace(/^[a-zA-Z]:/, '').replace(/\\/g, '/'),
- ext,
- )
-}
-
export function returnError (cb: () => any) {
try {
return cb()
diff --git a/packages/shared-utils/src/util.ts b/packages/shared-utils/src/util.ts
index 040acddc6..f5fde9b2b 100644
--- a/packages/shared-utils/src/util.ts
+++ b/packages/shared-utils/src/util.ts
@@ -331,9 +331,13 @@ export function reviveSet (val) {
// Use a custom basename functions instead of the shimed version
// because it doesn't work on Windows
-function basename (filename, ext) {
+export function basename (filename, ext) {
+ filename = filename.replace(/\\/g, '/')
+ if (filename.includes(`/index${ext}`)) {
+ filename = filename.replace(`/index${ext}`, ext)
+ }
return path.basename(
- filename.replace(/^[a-zA-Z]:/, '').replace(/\\/g, '/'),
+ filename.replace(/^[a-zA-Z]:/, ''),
ext,
)
}
diff --git a/packages/shell-dev-vue3/src/App.vue b/packages/shell-dev-vue3/src/App.vue
index 2deb62739..f6ff39053 100644
--- a/packages/shell-dev-vue3/src/App.vue
+++ b/packages/shell-dev-vue3/src/App.vue
@@ -21,6 +21,7 @@ import SetupScript from './SetupScript.vue'
import SetupDataLike from './SetupDataLike.vue'
import SetupTSScriptProps from './SetupTSScriptProps.vue'
import DomOrder from './DomOrder.vue'
+import IndexComponent from './IndexComponent/index.vue'
import { h, createApp } from 'vue'
import SimplePlugin from './devtools-plugin/simple'
@@ -51,6 +52,7 @@ export default {
SetupDataLike,
SetupTSScriptProps,
DomOrder,
+ IndexComponent,
inline: {
render: () => h('h3', 'Inline component definition'),
},
@@ -114,6 +116,7 @@ export default {
+
diff --git a/packages/shell-dev-vue3/src/IndexComponent/index.vue b/packages/shell-dev-vue3/src/IndexComponent/index.vue
new file mode 100644
index 000000000..a7e5dfc24
--- /dev/null
+++ b/packages/shell-dev-vue3/src/IndexComponent/index.vue
@@ -0,0 +1,3 @@
+
+ Index component
+