Skip to content

Commit

Permalink
feat: remove dev-ui async chunk
Browse files Browse the repository at this point in the history
  • Loading branch information
wen-haoming committed Dec 26, 2021
1 parent 15033d6 commit ca73f48
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [15]
node-version: [16]
steps:
- uses: actions/checkout@v2
- uses: pnpm/[email protected]
Expand Down
1 change: 0 additions & 1 deletion demo/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"sourceMap": true,
"jsx": "react-jsx"
},
"include": ["./src"]
Expand Down
3 changes: 0 additions & 3 deletions demo/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@ import VisualDev from './plugins/vite';
export default defineConfig({
plugins: [VisualDev(), react()],
base: '/visual-dev',
build: {
sourcemap: 'hidden',
},
});
24 changes: 13 additions & 11 deletions packages/dev-ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { onMounted, ref, shallowRef, defineAsyncComponent, h } from 'vue';
import { createPrefixContext, createDrawerContext, useHotkeys } from './hooks';
import { getRequest } from './utils';
import AimMode from './components/AimMode.vue';
const data = createDrawerContext();
const prefix = createPrefixContext('vd');
Expand Down Expand Up @@ -35,24 +35,26 @@ useHotkeys({
});
onMounted(async () => {
if (window.isDemo) {
AsyncApp.value = defineAsyncComponent(() => import('./components/AimMode.vue'));
return;
}
if (window.isDemo) return;
// if (window.isDemo) {
// AsyncApp.value = defineAsyncComponent(() => import('./components/AimMode.vue'));
// return;
// }
const { mode } = await getRequest('getConfig');
if (mode === 'aim') {
AsyncApp.value = defineAsyncComponent(() => import('./components/AimMode.vue'));
} else {
}
// if (mode === 'aim') {
// AsyncApp.value = defineAsyncComponent(() => import('./components/AimMode.vue'));
// } else {
// }
});
</script>

<template>
<div :class="`${prefix}-pos`">
<suspense>
<AimMode />
<!-- <suspense>
<Component :is="AsyncApp" />
</suspense>
</suspense>-->
</div>
</template>
<style lang="less">
Expand Down

0 comments on commit ca73f48

Please sign in to comment.