Skip to content

Commit 3c7f944

Browse files
committed
Fix components names on Windows
Fix #256
1 parent 032f57f commit 3c7f944

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/backend/index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ import { highlight, unHighlight, getInstanceRect } from './highlighter'
55
import { initVuexBackend } from './vuex'
66
import { initEventsBackend } from './events'
77
import { stringify, classify, camelize } from '../util'
8+
import path from 'path'
9+
10+
// Use a custom basename functions instead of the shimed version
11+
// because it doesn't work on Windows
12+
function basename (filename) {
13+
return path.basename(filename).replace(/^[a-zA-Z]:/, '').replace(/\\/g, '/')
14+
}
815

916
// hook should have been injected before this executes.
1017
const hook = window.__VUE_DEVTOOLS_GLOBAL_HOOK__
@@ -317,7 +324,7 @@ export function getInstanceName (instance) {
317324
}
318325
const file = instance.$options.__file // injected by vue-loader
319326
if (file) {
320-
return classify(require('path').basename(file).replace(/\.vue$/, ''))
327+
return classify(basename(file).replace(/\.vue$/, ''))
321328
}
322329
return instance.$root === instance
323330
? 'Root'

yarn.lock

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -369,14 +369,7 @@ browserify-zlib@^0.1.4:
369369
dependencies:
370370
pako "~0.2.0"
371371

372-
browserslist@^1.0.1, browserslist@^1.5.2:
373-
version "1.7.0"
374-
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-1.7.0.tgz#738df5b2971354d198b2fbd5a22c560d2d896084"
375-
dependencies:
376-
caniuse-db "^1.0.30000617"
377-
electron-to-chromium "^1.2.1"
378-
379-
browserslist@~1.6.0:
372+
browserslist@^1.0.1, browserslist@^1.5.2, browserslist@~1.6.0:
380373
version "1.6.0"
381374
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-1.6.0.tgz#85fb7c993540d3fda31c282baf7f5aee698ac9ee"
382375
dependencies:
@@ -459,7 +452,7 @@ caniuse-api@^1.5.2:
459452
lodash.uniq "^4.3.0"
460453
shelljs "^0.7.0"
461454

462-
caniuse-db@^1.0.30000346, caniuse-db@^1.0.30000613, caniuse-db@^1.0.30000617:
455+
caniuse-db@^1.0.30000346, caniuse-db@^1.0.30000613:
463456
version "1.0.30000617"
464457
resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000617.tgz#9b7fd81f58a35526315c83e60cb5f076f0beb392"
465458

@@ -1083,7 +1076,7 @@ ejs@~0.8.3:
10831076
version "0.8.8"
10841077
resolved "https://registry.yarnpkg.com/ejs/-/ejs-0.8.8.tgz#ffdc56dcc35d02926dd50ad13439bbc54061d598"
10851078

1086-
electron-to-chromium@^1.2.0, electron-to-chromium@^1.2.1:
1079+
electron-to-chromium@^1.2.0:
10871080
version "1.2.1"
10881081
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.2.1.tgz#63ac7579a1c5bedb296c8607621f2efc9a54b968"
10891082

0 commit comments

Comments
 (0)