Skip to content

Commit

Permalink
fix: docs build error (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
vtrbo committed Oct 31, 2023
1 parent 27aa364 commit 3d23116
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/.vitepress/components/run-code-editor/src/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const outputResult = ref<string>('')
function getTransformCode(code: string) {
return code.replace(
/import\s+{\s+(.*?)\s+}\s+from\s+['|"](.*?)['|"]/g,
(_, name, lib) => `const { ${name} } = window['${lib}']`,
(_, name, lib) => `const { ${name} } = (globalThis as any)['${lib}']`,
)
}
function handleRun() {
Expand Down
14 changes: 7 additions & 7 deletions docs/.vitepress/theme/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import * as STR from '@vtrbo/utils-str'
import * as TOOL from '@vtrbo/utils-tool'
import * as TREE from '@vtrbo/utils-tree'

window['@vtrbo/utils-arr'] = ARR
window['@vtrbo/utils-color'] = COLOR
window['@vtrbo/utils-is'] = IS
window['@vtrbo/utils-log'] = LOG
window['@vtrbo/utils-str'] = STR
window['@vtrbo/utils-tool'] = TOOL
window['@vtrbo/utils-tree'] = TREE
(globalThis as any)['@vtrbo/utils-arr'] = ARR;
(globalThis as any)['@vtrbo/utils-color'] = COLOR;
(globalThis as any)['@vtrbo/utils-is'] = IS;
(globalThis as any)['@vtrbo/utils-log'] = LOG;
(globalThis as any)['@vtrbo/utils-str'] = STR;
(globalThis as any)['@vtrbo/utils-tool'] = TOOL;
(globalThis as any)['@vtrbo/utils-tree'] = TREE

0 comments on commit 3d23116

Please sign in to comment.