]> git.immae.eu Git - github/fretlink/purs-loader.git/blame_incremental - README.md
Bumping version number to 1.0.0
[github/fretlink/purs-loader.git] / README.md
... / ...
CommitLineData
1# purs-loader
2
3> [PureScript](http://www.purescript.org) loader for [webpack](http://webpack.github.io)
4
5- Supports hot-reloading and rebuilding of single source files
6- Dead code elimination using the `bundle` option
7- Colorized build output using `purescript-psa` and the `psc: "psa"` option
8
9## Install
10
11Install with [npm](https://npmjs.org/package/purs-loader).
12
13```
14npm install purs-loader --save-dev
15```
16
17## Example
18
19```javascript
20const webpackConfig = {
21 // ...
22 loaders: [
23 // ...
24 {
25 test: /\.purs$/,
26 loader: 'purs-loader',
27 exclude: /node_modules/,
28 query: {
29 psc: 'psa',
30 src: ['bower_components/purescript-*/src/**/*.purs', 'src/**/*.purs'],
31 ffi: ['bower_components/purescript-*/src/**/*.js', 'src/**/*.js'],
32 }
33 }
34 // ...
35 ]
36 // ...
37}
38```
39
40Refer to the [purescript-webpack-example](https://github.com/ethul/purescript-webpack-example) for a more detailed example.
41
42### Options
43
44Default options:
45
46```javascript
47{
48 psc: 'psc',
49 pscArgs: {},
50 pscBundle: 'psc-bundle',
51 pscBundleArgs: {},
52 pscIde: false, // instant rebuilds using psc-ide-server (experimental)
53 pscIdeColors: false, // defaults to true if psc === 'psa'
54 bundleOutput: 'output/bundle.js',
55 bundleNamespace: 'PS',
56 bundle: false,
57 warnings: true,
58 output: 'output',
59 src: [
60 path.join('src', '**', '*.purs'),
61 path.join('bower_components', 'purescript-*', 'src', '**', '*.purs')
62 ],
63 ffi: [
64 path.join('src', '**', '*.js'),
65 path.join('bower_components', 'purescript-*', 'src', '**', '*.js')
66 ],
67}
68```
69
70### Instant rebuilds (experimental)
71
72Experimental support for instant rebuilds using `psc-ide-server` can be enabled
73via the `pscIde: true` option.