@kong-ui-public/vite-plugin-konnect-loading-template
TypeScript icon, indicating that this package has built-in type declarations

0.0.2-pr.981.60aa175a.0 • Public • Published

@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 `htpps://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 a devDependency in your host application

    # pnpm
    pnpm --filter "your-package" add -D cheerio
    
    # yarn
    yarn add -D cheerio

Installation

First, 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/konnect-app-shell/vite-plugins'

export default defineConfig({
  // ... more code
  plugins: [
    vue(),
    // Inject the static Konnect app loading template
    KonnectLoadingTemplateVitePlugin(),
  ]
})

Readme

Keywords

none

Package Sidebar

Install

npm i @kong-ui-public/vite-plugin-konnect-loading-template

Weekly Downloads

1

Version

0.0.2-pr.981.60aa175a.0

License

Apache-2.0

Unpacked Size

774 kB

Total Files

7

Last publish

Collaborators

  • konginc