Scaffolding
The information here applies only for Showpad Apps v1 (deprecated). While your existing v1 Showpad Apps will continue to work, we strongly recommend:
- Creating new apps with Showpad Apps v2
- Migrating your v1 apps to v2
For a fast and lean development experience, the first step when developing a custom Showpad App is to create a project with the Vite build tool.
Key features include:
- Dev server that provides rich feature enhancements
- Build command to bundle your code for pre-configured output
- Wide browser compatibility
- TypeScript support
- and more!
Create Vite Project
Open a terminal and use the following command to create your project:
- npm
- yarn
npm init vite@latest create-experience-app
yarn create vite create-experience-app
The Vite CLI will prompt you to select a framework and a variant. Select the following:
- Select a framework: Vanilla
- Select a variant: TypeScript
Execute the suggested commands.
Change working directory
Change the working directory to your new project:
- MacOS
- Linux
- Windows (Powershell)
cd create-experience-app
cd create-experience-app
cd create-experience-app
Install required packages
Vite will prompt you to install the required packages from the package.json
file. Use your preferred package manager to run the following:
- npm
- yarn
npm install
yarn
Configure Filepaths
Showpad Apps are displayed in iframes. Absolute paths might resolve incorrectly which can cause issues when importing files or routing in your single-page application (SPA). Therefore, you should configure Vite to use relative paths.
- MacOS
- Linux
- Windows (Powershell)
touch vite.config.ts
touch vite.config.ts
ni vite.config.ts
Add the following to vite.config.ts
to specify a relative base path:
export default {
base: './',
};