Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ethul/purescript-webpack-example
Example using PureScript with webpack
https://github.com/ethul/purescript-webpack-example
Last synced: about 2 months ago
JSON representation
Example using PureScript with webpack
- Host: GitHub
- URL: https://github.com/ethul/purescript-webpack-example
- Owner: ethul
- License: mit
- Created: 2016-03-12T23:20:16.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T17:04:09.000Z (about 2 years ago)
- Last Synced: 2024-04-09T19:56:32.094Z (9 months ago)
- Language: PureScript
- Size: 967 KB
- Stars: 54
- Watchers: 6
- Forks: 18
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# purescript-webpack-example
Example project using PureScript with webpack.
## Installation
```bash
bower install
npm install
```## Running
### Using locally installed binaries
On most system this should be enough, because npm should take care of extra
depedencies, including `purescript` and `purescript-psa`.
Note, that this will use the compiler from `node_modules/.bin/`, not
the one that might have installed globally or the one that may be present
in your `$PATH`. This will fail on systems like Nix, where you'll need to use
globally installed binaries (patched version of `psc`, while `npm` will supply
unpatched version).```
npm run webpack
npm start
```To test this in the browser with the webpack-dev-server.
```bash
bower installnpm install
# http://localhost:4008/
npm run webpack:server
```### Using globally installed binaries
`npm install` should have installed extra binary dependencies required to run
this example to `node_modules/.bin`. However, if you want to use the `psc`
compiler that you have installed globally (i.e., the one in `$PATH`), you can
just call webpack directly:```
webpack
```As always, you can use `webpack --watch` option to enable automatic recompilation
on file changes.However, if you want to use globally installed binaries, this means that you'll
have to take care of all binary dependencies yourself. Right now, this includes
having in your `$PATH`:* `psc` that comes from `purescript` (`haskellPackages.purescript` on Nix)
* `psa` that comes from `purescript-psa` (on Nix, you'll have to install it
yourself via `node2nix -i node-packages.json` and `nix-env -f default.nix -iA
purescript.psa`; node-packages.json is a file you create yourself containing
`[ "purescript-psa" ]`). You can remove the dependency on `psa` by changing `psc: 'psa'`
to `psc: 'psc'` inside `webpack.config.js`. `psa` just provides clearer compilation
messages compared to `psc`
* `webpack` (on Nix, `nodePackages.webpack`)
* `node` that comes from `nodejs`## Additional examples
- [Fast rebuilds](https://github.com/ethul/purescript-webpack-example/tree/fast-rebuilds)
- [Psc package](https://github.com/ethul/purescript-webpack-example/tree/psc-package)
- [Source maps](https://github.com/ethul/purescript-webpack-example/tree/source-maps)
- [Spago](https://github.com/ethul/purescript-webpack-example/tree/spago)