Getting Started

You can create a fresh elm-pages project with the init command.

npx elm-pages init my-project
cd my-project
npm install
npx elm-pages dev

This creates a new project in my-project/ and starts the dev server. You can then add new routes using the CLI commands below.

CLI commands#

  • elm-pages dev - Start the elm-pages dev server
  • elm-pages run AddRoute Slide.Number_ Generate scaffolding for a new Page Module (learn about running scripts and modifying the scaffolding script in the Scaffolding section)
  • elm-pages build - generate a full production build in the dist/ folder. You'll often want to use a CDN service like Netlify or Vercel to deploy these generated static files

The dev server#

elm-pages dev gives you a dev server with hot module replacement built in. It even reloads your BackendTasks any time you change them.