This template should help get you started developing a headless app using Storyblok JS SDK, Qwik in Vite.
You can find the full writen tutorial on Add a headless CMS with Live Preview to Qwik in 5 Minutes.
To be able to run this project you need to have a Storyblok account. If you don't have one yet, you can register for free at Storyblok. Did I mention it's free?.
To use this starter application, follow these steps:
- Clone this repository
- Install dependencies with
pnpm install - Add the preview token from your Storyblok space to the
.envfile
PUBLIC_STORYBLOK_TOKEN=W1vLyxT5rQ15jBpANjnv0gtt
- Run the project with
pnpm start - Open your browser and go to
https://localhost:5173/
See Vite Configuration Reference.
pnpm installDevelopment mode uses Vite's development server. The dev command will server-side render (SSR) the output during development.
pnpm start # or `yarn start`Note: during dev mode, Vite may request a significant number of
.jsfiles. This does not represent a Qwik production build.
The production build will generate client and server modules by running both client and server build commands. The build command will use Typescript to run a type check on the source code.
pnpm build # or `yarn build`The preview command will create a production build of the client modules, a production build of src/entry.preview.tsx, and run a local server. The preview server is only for convenience to preview a production build locally and should not be used as a production server.
pnpm preview # or `yarn preview`