This is a boilerplate for starting a real world project using the purescript-halogen library for declarative user interfaces.
- Bootstrap 4.1.2 is included.
- Update to latest purescript-halogen (only psc-package)
- psc-package is included and it is default
- A rational structure of project with routing.
- Webpack is optional.
This guide assumes you already have Git and Node.js installed with npm
somewhere on your path.
npm install --global purescript pulp psc-package
First clone the repo and step into it:
git clone https://github.com/jimmyhuco/halogen-boilerplate.git hello-halogen
cd hello-halogen
psc-package install
The project can now be built with:
npm run build
This will build the PureScript source code and produce a bundled JS file as dist/js/app.js
.
If you open dist/index.html
you should now have a basic working Halogen app.
You can also use the command:
npm run watch
To start a process that will watch the source files and trigger a reload whenever they are modified. Alternatively...
If you're using an editor that supports purs ide
, there's an option for getting near-instant builds of the app while you work on it:
npm install
npm run watch-fast
First, you should have to install Webpack, and then it will start a watch process to rebundle the app whenever the output files are changed. Since purs ide
rebuilds modules on save, this means you can use this much faster bundle-only rebuild script.
- purescript-halogen-bootstrap don't include bootstrap4, so I just add some "demo code" to use bootstrap4.
- Demo images are all from unsplash.com.
- I learned "watch-fast" from purescript-halogen-template
- Thank you @snackycracky. He update purescript from 0.11.6 to 0.12.