A template for rollup, svelte, and sass.
- Clone Template with degit.
- Update package.json
- Set "name" in package.json.
- Replace Default PORT in package.json 'start' script (
${PORT:-7000}) - Update index.html
- If you want a font other than Roboto update (or delete) the Google Fonts
<link>. - Create each a file in 'src/assets' for each favicon referenced in index.html.
- Delete unwanted linked assets or meta tags.
- Delete TODOs.
- Update app.scss
- If you've changed the font in index.html, update app.scss to match.
- Delete TODOs.
- Run
npm install. - Run
git initandgit add remote origin URL_TO_ORIGIN(fix URL first). - Run `git commit -m 'Initial Commit'
- Run
npm run devto start a server with watching for app changes. - If you change
index.htmlyou'll need to restart your server. - If you want to run on a non-default port run
PORT=NEW_PORT npm run dev - Any files or folders in
assetswill be copied intopublic. - Any files referenced by
app.scsswill be built intopublic. - Any files referenced by
app.jswill be build intopublic.
- Run
npm run buildto copy and build all assets and hash the javascript and css built.
Configure s3 or cloudflare to server all files with a very aggressive cache. The content hashing will bust the caching for updated js and css files.
You'll want to serve all files with heavy caching except index.html (which should never be cached) and any icons or images from src/assets (unless you version these manually).
On CI server the steps to deploy will be roughly:
- Use a recent
nodeversion. npm install && npm run build.- Copy
publicfolder to somethign like s3 or cloudflare.