Skip to content

Commit f60552e

Browse files
author
elevatebart
committed
fix: update preview debug & dependencies
1 parent 5f4fdc2 commit f60552e

File tree

3 files changed

+27
-25
lines changed

3 files changed

+27
-25
lines changed

Diff for: package-lock.json

+21-21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
"@vue/compiler-sfc": "^3.2.47",
2020
"acorn": "^8.8.2",
2121
"acorn-walk": "^8.2.0",
22-
"core-js": "^3.30.1",
22+
"core-js": "^3.30.2",
2323
"debounce": "^1.2.1",
2424
"hash-sum": "^2.0.0",
2525
"prismjs": "^1.29.0",
26-
"vue-inbrowser-compiler-sucrase": "^4.72.0",
26+
"vue-inbrowser-compiler-sucrase": "^4.72.1",
2727
"vue-inbrowser-prismjs-highlighter": "^4.69.1",
2828
"vue-prism-editor": "^2.0.0-alpha.2"
2929
},
@@ -32,7 +32,7 @@
3232
"@types/debounce": "^1.2.1",
3333
"@types/hash-sum": "^1.0.0",
3434
"@types/jsdom": "^21.1.1",
35-
"@types/node": "^20.0.0",
35+
"@types/node": "^20.1.0",
3636
"@types/prismjs": "^1.26.0",
3737
"@uivjs/vue-github-corners": "^1.0.1",
3838
"@vitejs/plugin-vue": "^4.2.1",

Diff for: src/Preview.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ export default defineComponent({
161161
} : {},
162162
scopeAttribute
163163
);
164-
this.compiledCodeForDebug = JSON.stringify(renderedComponent)
164+
if(this.debug){
165+
this.compiledCodeForDebug = Object.entries(renderedComponent).map(([key, code]) => typeof code === 'string' ? `<${key}>\n${code}\n</${key}>` : '').join("\n\n")
166+
}
165167
style = renderedComponent.style;
166168
if (renderedComponent.script) {
167169
// if the compiled code contains a script it might be "just" a script

0 commit comments

Comments
 (0)