0.0.3 • Published 4 months ago

niki-report-builder v0.0.3

Weekly downloads
-
License
-
Repository
-
Last release
4 months ago

Astro Starter Kit: Basics

pnpm create astro@latest -- --template basics

Open in StackBlitz Open with CodeSandbox Open in GitHub Codespaces

🧑‍🚀 Seasoned astronaut? Delete this file. Have fun!

just-the-basics

🚀 Project Structure

Inside of your Astro project, you'll see the following folders and files:

/
├── public/
│   └── favicon.svg
├── src/
│   ├── layouts/
│   │   └── Layout.astro
│   └── pages/
│       └── index.astro
└── package.json

To learn more about the folder structure of an Astro project, refer to our guide on project structure.

🧞 Commands

All commands are run from the root of the project, from a terminal:

CommandAction
pnpm installInstalls dependencies
pnpm devStarts local dev server at localhost:4321
pnpm buildBuild your production site to ./dist/
pnpm previewPreview your build locally, before deploying
pnpm astro ...Run CLI commands like astro add, astro check
pnpm astro -- --helpGet help using the Astro CLI

👀 Want to learn more?

Feel free to check our documentation or jump into our Discord server.

Instruções para usar o componente ExternalComponent em outra aplicação React

  1. Configure o build em modo biblioteca (Vite library mode) no arquivo astro.config.mjs ou vite.config.js.
    // ...existing configuration... // Exemplo de configuração: / export default { build: { lib: { entry: './src/components/ExternalComponent.jsx', name: 'MeuComponente', fileName: 'meu-componente' } } }; /
  2. Execute o build com astro build (ou via script definido).
  3. Na aplicação React externa, importe o componente:
    import ExternalComponent from 'caminho/para/meu-componente';
    // ou via package, se publicado
  4. Use-o normalmente:
    <ExternalComponent message="Olá, mundo!" />

Instruções para build da biblioteca

Para compilar o componente como biblioteca, execute:

LIB_BUILD=true pnpm vite build

O build gerará os arquivos que poderão ser importados em outra aplicação React.