First, run the development servers:
npm run dev-api
npm run dev
Open http://localhost:3000/dev/home with your browser to develop with the home page.
Before actually creating the view, you need to decide what its URL will be.
Vike will map the src/pages
directory structure on the disk to the view URL.
For example, a page located at src/pages/category/subcategory/my-page/+Page.tsx
will be available at the URL /category/subcategory/my-page.html
.
To create a new view, copy pages/dev/base-page
to the location for the new
view. Then edit it:
- Set the
<title>
tag in+config.ts
. - Configure
IframeBridgeProvider
:- If the view needs a sample to work, add
requireSample
. - If the view can work standalone outside of
on-tabs
, addallowStandalone
.
- If the view needs a sample to work, add
- Create a new component to design the page in
components/your/page/index.tsx
, and render it as a child ofIframeBridgeProvider
. - Open the dev home page, select the new view in the top-right box (if you delete the path, you can use keyboard arrows to select it from all available pages) and select a demo sample to load the view with it.
Go to the GitHub actions page and select "Run workflow" to make a HEAD test build.
The build is published to https://www.lactame.com/react/views/HEAD/
To learn more about Vike, take a look at the following resources:
- Vike Documentation - learn about Vike features and API.