Skip to content

Commit

Permalink
ci: deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
nailiable committed Aug 9, 2024
1 parent 9882384 commit 63bebf7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"vitejs",
"Vitesse",
"vitest",
"vueuc",
"vueuse",
"watchrss",
"Webfont"
Expand Down
4 changes: 0 additions & 4 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ declare module 'vue' {
GradientBackground: typeof import('./components/GradientBackground.vue')['default']
ImageBackground: typeof import('./components/ImageBackground.vue')['default']
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
README: typeof import('./components/README.md')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
TheCounter: typeof import('./components/TheCounter.vue')['default']
TheFooter: typeof import('./components/TheFooter.vue')['default']
TheInput: typeof import('./components/TheInput.vue')['default']
}
}
14 changes: 13 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import WebfontDownload from 'vite-plugin-webfont-dl'
import VueRouter from 'unplugin-vue-router/vite'
import { VueRouterAutoImports } from 'unplugin-vue-router'
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
import { setup } from '@css-render/vue3-ssr'

export default defineConfig({
resolve: {
Expand Down Expand Up @@ -163,10 +164,21 @@ export default defineConfig({
onFinished() {
generateSitemap()
},
async onBeforePageRender(_, __, appCtx) {
const { collect } = setup(appCtx.app)
;(appCtx as any).__collectStyle = collect
return undefined
},
async onPageRendered(_, renderedHTML, appCtx) {
return renderedHTML.replace(
/<\/head>/,
`${(appCtx as any).__collectStyle()}</head>`,
)
},
},

ssr: {
// TODO: workaround until they support native ESM
noExternal: ['workbox-window', /vue-i18n/],
noExternal: ['workbox-window', /vue-i18n/, 'naive-ui', 'vueuc', 'date-fns'],
},
})

0 comments on commit 63bebf7

Please sign in to comment.