- Svelte rollup (via
degit
) - Routify "Install to existing project" (via
npm i
) - Materialify "Advanced Install" (via
npm i
)
- Rollup has been configured to emit modules (as Routify expects) to
public/modules
. - Materialify requires
svelte-preprocess
. Postinstall message from svelte-preprocess:echo "[svelte-preprocess] Don't forget to install the preprocessors packages that will be used: node-sass/sass, stylus, less, postcss & postcss-load-config, coffeescript, pug, etc..."
- hence:
npm i -D node-sass
- hence:
- Following Materialify advanced install, continue to Materialify Usage and follow the instructions
- Make sure
public/index.html
has the proper css and js import statements - TODO: add nollup some day
- Here are some details about overriding the materialify theme:
- Make sure your
svelte.config.js
preprocess includePaths match the location of_material_theme.scss
- Make sure your
rollup.config.js
properly imports the preprocess fromsvelte.config.js
- Do not rename
_material_theme.scss
(materialify is hard coded to that name!) - Custom overrides must import from svelte-materialify/src` which is not compiled.
- Make sure your
- You may wish to create a simple, small, fast container that can run anywhere.
- This
Dockerfile
runs a multistage build:- First (intermediate) container uses node to build the app.
- 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.
- Install Docker on your system.
- Build the docker image following the directives in the Dockerfile
docker build -t johnknapp/spa-template .
Change the tag name as needed. - 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.) - Think about the nginx listenting port and the docker container external:internal ports you use.
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
- Before you can deploy your containerized SPA, you need to push your container to a container registry. Registry details for two popular low-cost hosting options:
- You may also choose to push your container to a private container registry you host yourself or use Docker Hub or a similar service.