8000 feat: add support for viewing sourcemap by edison1105 · Pull Request #341 · vuejs/repl · GitHub
[go: up one dir, main page]

Skip to content

feat: add support for viewing sourcemap #341

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 13, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: minor tweaks
  • Loading branch information
edison1105 committed Jun 13, 2025
commit d72b32cbca52839c379031bbde658fe307dd9fc9
6 changes: 3 additions & 3 deletions src/Repl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface Props {
store?: Store
autoResize?: boolean
showCompileOutput?: boolean
showOpenSource?: boolean
showOpenSourceMap?: boolean
showImportMap?: boolean
showTsConfig?: boolean
clearConsole?: boolean
Expand Down Expand Up @@ -54,7 +54,7 @@ const props = withDefaults(defineProps<Props>(), {
store: () => useStore(),
autoResize: true,
showCompileOutput: true,
showOpenSource: false,
showOpenSourceMap: false,
showImportMap: true,
showTsConfig: true,
clearConsole: true,
Expand Down Expand Up @@ -107,7 +107,7 @@ defineExpose({ reload })
ref="output"
:editor-component="editor"
:show-compile-output="props.showCompileOutput"
:show-open-source="props.showOpenSource"
:show-open-source-map="props.showOpenSourceMap"
:ssr="!!props.ssr"
/>
</template>
Expand Down
4 changes: 2 additions & 2 deletions src/output/Output.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const props = defineProps<{
editorComponent: EditorComponentType
showCompileOutput?: boolean
ssr: boolean,
showOpenSource?: boolean
showOpenSourceMap?: boolean
}>()

const { store } = inject(injectKeyProps)!
Expand All @@ -35,7 +35,7 @@ const mode = computed<OutputModes>({
})

const showSourceMap = computed(() => {
return props.showOpenSource && mode.value === 'js' || mode.value === 'ssr'
return props.showOpenSourceMap && (mode.value === 'js' || mode.value === 'ssr')
})

function openSourceMap() {
Expand Down
2 changes: 1 addition & 1 deletion test/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const App = {
theme: theme.value,
previewTheme: previewTheme.value,
editor: MonacoEditor,
showOpenSource: true,
showOpenSourceMap: true,
// layout: 'vertical',
ssr: true,
sfcOptions: {
Expand Down
0