Skip to content

Commit

Permalink
Move global process polyfill into typescript.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
remcohaszing committed Sep 5, 2024
1 parent 1331dd3 commit a82c017
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 6 additions & 0 deletions example/scripts/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ import { create as createTypeScriptPlugins } from 'volar-service-typescript'
import { type TextDocument } from 'vscode-languageserver-textdocument'
import { URI } from 'vscode-uri'

globalThis.process = {
cwd() {
return '/'
}
} as NodeJS.Process

/**
* Convert markdown content to a DOM node.
*
Expand Down
7 changes: 0 additions & 7 deletions example/typescript.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@
<div class="buttons">
<button id="format-button" type="button">Format</button>
</div>
<script>
globalThis.process = {
cwd() {
return '/'
}
}
</script>
<script type="module" src="./scripts/typescript.ts"></script>
</body>
</html>

0 comments on commit a82c017

Please sign in to comment.