Skip to content

Commit

Permalink
fix: build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
azabroflovski committed Feb 24, 2024
1 parent beb0837 commit c1aab01
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
7 changes: 7 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,12 @@ export default defineConfig({
socialLinks: [
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' }
]
},
vite: {
build: {
rollupOptions: {
external: ["vue/server-renderer", "vue"]
}
}
}
})
2 changes: 1 addition & 1 deletion docs/quick-start.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts" setup>
import { useData } from 'vitepress'
import { initNativeModal } from '../src/lib/index.js'
import {computed} from ".vitepress/cache/deps/vue.js";
import { computed } from 'vue'
initNativeModal()

const { isDark } = useData()
Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,5 @@
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "4.6.1"
},
"overrides": {
"vue": "latest"
}
}
6 changes: 3 additions & 3 deletions src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import './styles/default.css'
import { getDialogElement } from './helpers'

export function initNativeModal() {
window.__NATIVE_MODAL__ = {
ACTIVE_MODALS: [],
ONETIME_MODALS: new Set()
// SSR FRIENDLY
if (typeof document === 'undefined' || typeof window === 'undefined') {
return
}

function openDialog(dialog: HTMLDialogElement) {
Expand Down

0 comments on commit c1aab01

Please sign in to comment.