Having written configurations like this so many times, and having forgotten how to do it almost every time, I thought I should finally create a reference for myself (particularly now that we have GitHub templates 🎉)
The style is a bit opinionated (#sorrynotsorry) but generally adheres to best practices as I understand them. Feedback and suggestions are twelcome.
- Webpack 4.x
- Babel 7.x
- PureScript 0.13.x
I'm not a fan of managing purescript tooling (purs
, spago
...) with Node, and
hence these things aren't listed in package.json
. In order to work out of the
box you should have purs
and psc-package
available somewhere on your $PATH
.
In most cases it should be enough to grab a binary from the relevant releases
page (see purescript releases* and spago releases) and
put it in a bin
folder somewhere. For non-trivial projects you'll probably
want to use something more robust (e.g. Nix; shameless self plug).
* Bonus points: pipe the tarball to shasum
and make sure it matches the
relavant .sha
file.
- All the
*rc
files apart from.babelrc
are optional. Delete them if you want. css-modules
are cool, I strongly recommend them. And webpack'scss-loader
supports them out the box.- I've used React (specifically,
react-basic-hooks
), but that's just for the sake of example. Swap it out for whatever you want to use. - PureScript's local documentation is great, you should use it:
spago docs
👌