svelte-rollup-routify-smui-spa

Svelte Rollup Routify Smui Spa

Minimal Svelte / Routify / Svelte Material UI SPA template

Minimal Svelte / Routify / Svelte Material UI SPA template

What's in the box:

Setup notes:

  • Rollup has been configured to emit modules (as Routify expects) to public/modules.
  • Make sure public/index.html has the proper css and js import statements
    • Including modules/main.css
  • To use the material styles within SMUI, you must import components with /styled appended to the import source. (This is part of the SMUI "Advanced Styling Method")
    • i.e. import Button from '@smui/button/styled'; versus @smui/button

Containerization notes:

  • You may wish to create a simple, small, fast container that can run anywhere.
  • This Dockerfile runs a multistage build:
    1. First (intermediate) container uses node to build the app.
    2. Second (final) container copies the output of npm run bulid (public folder) into a minimal linux distro to run the nginx web server.
  • The nginx-spa.conf, configured for an SPA, is copied into the container. You should review and refine this file to suit your needs.

To prepare and run your containerized SPA:

  1. Install Docker on your system.
  2. Build the docker image following the directives in the Dockerfile docker build -t johnknapp/spa-template . Change the tag name as needed.
  3. Run the image you just built in your local development environment. docker run --rm -p80:8080 johnknapp/spa-template. (The --rm flag removes the container upon exit.)
  4. Think about the nginx listenting port and the docker container external:internal ports you use.

Common docker commands to know:

  • docker help
  • docker image ls
  • docker image prune
  • docker ps -a
  • docker exec -it <cid> /bin/sh (container id)
  • docker container logs -f <cid>
  • docker container prune

Deployment notes:

Top categories

Loading Svelte Themes