0.0.2-pr.981.60aa175a.0 • Published 2 years ago
@kong-ui-public/vite-plugin-konnect-loading-template v0.0.2-pr.981.60aa175a.0
@kong-ui-public/vite-plugin-konnect-loading-template
A Vite plugin that injects a static HTML Konnect loading template in the host application's root div#app
element that is displayed until the app has finished hydrating. The template is manually compiled from the KonnectAppShell > AppLayout
components, and includes (inline) all necessary styles.
The template, by default, is hidden for the following URL paths on the Konnect UI domain(s):
// Paths defined in `https://github.com/shared-ui-components/packages/core/konnect-app-shell/vite-plugins/vite-plugin-konnect-app-loading-template/template.html`
const excludedPaths = [
'/login',
'/logout',
'/register',
'/accept-invitation',
'/forgot-password',
'/reset-password',
'/org-switcher',
'/onboarding',
]
Requirements
cheerio
must be installed as adevDependency
in your host application# pnpm pnpm --filter "your-package" add -D cheerio # yarn yarn add -D cheerio
Installation
# pnpm
pnpm --filter "{your package name}" add -D @kong-ui-public/vite-plugin-konnect-loading-template
# yarn
yarn add -D @kong-ui-public/vite-plugin-konnect-loading-template
Ensure that your host app utilizes Vue's default root container in it's /index.html
file:
<div id="app"></div>
Next, import the Vite plugin in your app's vite.config.ts
file (if you are in the konnect-ui-apps
repository, the loading template is already configured)
// vite.config.ts
import { defineConfig } from 'vite'
import KonnectLoadingTemplateVitePlugin from '@kong-ui-public/vite-plugin-konnect-loading-template'
export default defineConfig({
// ... more code
plugins: [
vue(),
// Inject the static Konnect app loading template
KonnectLoadingTemplateVitePlugin(),
]
})
0.0.2-pr.981.77de7d40.0
2 years ago
0.0.2-pr.981.60aa175a.0
2 years ago