feat(templates): update basic template readme
This commit is contained in:
parent
0e417d5769
commit
e71c7d22b9
2 changed files with 19 additions and 35 deletions
BIN
assets/template-basic.png
Normal file
BIN
assets/template-basic.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 424 KiB |
|
@ -1,42 +1,26 @@
|
||||||
# Nitro Minimal Starter
|
# McFly Starter Project
|
||||||
|
|
||||||
Look at the [Nitro documentation](https://nitro.unjs.io/) to learn more.
|
**McFly** is a no-framework framework that assists in leveraging the web platform
|
||||||
|
|
||||||
## Setup
|
|
||||||
|
|
||||||
Make sure to install the dependencies:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# npm
|
|
||||||
npm install
|
|
||||||
|
|
||||||
# yarn
|
|
||||||
yarn install
|
|
||||||
|
|
||||||
# pnpm
|
|
||||||
pnpm install
|
|
||||||
```
|
```
|
||||||
|
npm create mcfly@latest
|
||||||
## Development Server
|
|
||||||
|
|
||||||
Start the development server on <http://localhost:3000>
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run dev
|
|
||||||
```
|
```
|
||||||
|

|
||||||
|
|
||||||
## Production
|
## Features
|
||||||
|
- Create web apps with vanilla custom elements
|
||||||
|
- Write real .HTML files
|
||||||
|
- Have no frameworks or reactivity libraries on the browser
|
||||||
|
- Use server-side rendering
|
||||||
|
- Deploy anywhere
|
||||||
|
|
||||||
Build the application for production:
|
## Special directories
|
||||||
|
**1. `src/pages`**
|
||||||
|
- file based routing for `.html` files
|
||||||
|
- directly use custom elements & static fragments (no imports or registry maintenance needed)
|
||||||
|
- use `<script server:setup>` to define logic that runs on the server, which then gets stripped away
|
||||||
|
|
||||||
```bash
|
**2. `src/components`**
|
||||||
npm run build
|
- custom element constructor files (only `.js` files for now)
|
||||||
```
|
- all components are automatically registered using their file names; a `hello-world.js` component can be used as `<hello-world>`
|
||||||
|
- static `.html` fragments; a `my-header.html` fragment can be directly used as `<my-header>`
|
||||||
Locally preview production build:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run preview
|
|
||||||
```
|
|
||||||
|
|
||||||
Check out the [deployment documentation](https://nitro.unjs.io/deploy) for more information.
|
|
||||||
|
|
Loading…
Reference in a new issue