demoup-test
TypeScript icon, indicating that this package has built-in type declarations

0.2.4 • Public • Published

demoup

Create react component demo app with vite in a simple step.

Usage

// index.ts
import { createRoot } from "react-dom/client";
import { createReactApp } from "demoup";

// `import.meta.glob` is a vite-only feature. For glob pattern, any suffix is
// okay but we recommend using `demo.tsx`.
const modules = import.meta.glob("./**/*.demo.tsx");

createReactApp(modules).then((app) => {
  const root = createRoot(document.getElementById("app")!);
  root.render(app);
});
// *.demoup.tsx
export const config = {
  title: "Demo",
};

export const DemoA = () => <div>DemoA</div>;

export const DemoB = () => <div>DemoA</div>;

Readme

Keywords

Package Sidebar

Install

npm i demoup-test

Weekly Downloads

2

Version

0.2.4

License

MIT

Unpacked Size

7.32 kB

Total Files

10

Last publish

Collaborators

  • 07akioni