Part 3 of the hit series "Webapp Boilerplate"!
- Web
- App
- Boilerplate
First, decide you want to build a webapp. Once you're done with that, decide if you are going to use linux and make. If you're still here then I guess this is for you. You need:
To install build dependencies yarn install
, and you're all set!
make build
(or simplymake
) will build all the js, css, html and copy it to thebuild
directory.make serve
to serve up thebuild
directory (on all interfaces, port 8080 by default).make watch
to build js, css, html on the fly as files change, serve them up, and create a livereload server.make clean
does the usual.
JavaScript is built using ES6 import
statements and rollup
to bundle them together. src/app.js
is the default entrypoint. Add more rules as needed for more bundles, and then include them script tags in src/index.html
CSS is simply concatenated together. all of src
is searched for css files, so if you prefer to put your css right next to your js, you good.
Finally, src/index.html
is merely copied over into the build directory. In fact, everything ends up in build
.
Also don't forget to edit a few easy-to-miss thingies:
README.md
(this file) probably needs an updatepackage.json
has a few fields you want to update: "name", "version", "description", and "author".- in
src/index.html
, dont forget to update the<title>
tag.
would be nice
- babel
- sass