@nkduy/plugin-kdu-jsx
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

@nkduy/plugin-kdu-jsx

Provides Kdu 3 JSX & TSX support with HMR.

// vite.config.js
import kduJsx from '@nkduy/plugin-kdu-jsx'

export default {
  plugins: [
    kduJsx({
      // options
    })
  ]
}

HMR Detection

This plugin supports HMR of Kdu JSX components. The detection requirements are:

  • The component must be exported.
  • The component must be declared by calling defineComponent via a root-level statement, either variable declaration or export declaration.

Supported patterns

import { defineComponent } from 'kdu'

// named exports w/ variable declaration: ok
export const Foo = defineComponent(...)

// named exports referencing variable declaration: ok
const Bar = defineComponent(...)
export { Bar }

// default export call: ok
export default defineComponent(...)

// default export referencing variable declaration: ok
const Baz = defineComponent(...)
export default Baz

Non-supported patterns

// not using `defineComponent` call
export const Bar = { ... }

// not exported
const Foo = defineComponent(...)

Readme

Keywords

none

Package Sidebar

Install

npm i @nkduy/plugin-kdu-jsx

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

9.09 kB

Total Files

5

Last publish

Collaborators

  • nkduy