[✨] Added eruda debug (?debug=true)
This commit is contained in:
parent
f465580388
commit
86cc529c24
3 changed files with 18 additions and 2 deletions
6
package-lock.json
generated
6
package-lock.json
generated
|
|
@ -10,6 +10,7 @@
|
|||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@ptkdev/logger": "^1.8.0",
|
||||
"eruda": "^3.0.1",
|
||||
"filer": "^1.4.1",
|
||||
"prism-code-editor": "^1.2.2",
|
||||
"prismjs": "^1.29.0",
|
||||
|
|
@ -1846,6 +1847,11 @@
|
|||
"is-arrayish": "^0.2.1"
|
||||
}
|
||||
},
|
||||
"node_modules/eruda": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/eruda/-/eruda-3.0.1.tgz",
|
||||
"integrity": "sha512-6q1Xdwga4JTr1mKSW4mzuWSSbmXgqpm/8Wa1QGFGfCWRjC0bCQjbS4u06M1te1moucIS3hBLlbSTPWYH2W0qbQ=="
|
||||
},
|
||||
"node_modules/es-abstract": {
|
||||
"version": "1.22.2",
|
||||
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.2.tgz",
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@ptkdev/logger": "^1.8.0",
|
||||
"eruda": "^3.0.1",
|
||||
"filer": "^1.4.1",
|
||||
"prism-code-editor": "^1.2.2",
|
||||
"prismjs": "^1.29.0",
|
||||
|
|
|
|||
13
src/index.ts
13
src/index.ts
|
|
@ -1,7 +1,7 @@
|
|||
import './style.less'
|
||||
|
||||
import StatusBar from './statusbar.ts'
|
||||
import WM from './wm.ts'
|
||||
import StatusBar from './statusbar'
|
||||
import WM from './wm'
|
||||
|
||||
import * as fs from 'fs'
|
||||
|
||||
|
|
@ -16,3 +16,12 @@ declare global {
|
|||
window.statusBar = new StatusBar()
|
||||
window.wm = new WM()
|
||||
window.fs = new (window as any).Filer.FileSystem()
|
||||
|
||||
const params = new URLSearchParams(window.location.search)
|
||||
|
||||
async function enableDebug() {
|
||||
const { default: eruda } = await import("eruda")
|
||||
eruda.init()
|
||||
}
|
||||
|
||||
if (params.get("debug")) enableDebug()
|
||||
Loading…
Add table
Reference in a new issue