]> git.immae.eu Git - github/fretlink/purs-loader.git/blame - README.md
Bumping version number to 2.0.1
[github/fretlink/purs-loader.git] / README.md
CommitLineData
a42f24b8 1# purs-loader
2
08b34471 3> [PureScript](http://www.purescript.org) loader for [webpack](http://webpack.github.io)
a42f24b8 4
7de41f10
AM
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
a42f24b8 9## Install
10
63d6a244 11Install with [npm](https://npmjs.org/package/purs-loader).
12
a42f24b8 13```
a9a26a84 14npm install purs-loader --save-dev
2b2207bd 15
16npm install purs-loader@next --save-dev
689268da 17
18npm install purs-loader@purescript-0.8 --save-dev
19
20npm install purs-loader@purescript-0.9 --save-dev
a42f24b8 21```
22
a42f24b8 23## Example
24
7de41f10
AM
25```javascript
26const webpackConfig = {
27 // ...
28 loaders: [
29 // ...
30 {
31 test: /\.purs$/,
32 loader: 'purs-loader',
33 exclude: /node_modules/,
34 query: {
35 psc: 'psa',
2b2207bd 36 src: ['bower_components/purescript-*/src/**/*.purs', 'src/**/*.purs']
7de41f10
AM
37 }
38 }
39 // ...
40 ]
41 // ...
42}
43```
44
44eb153b 45Refer to the [purescript-webpack-example](https://github.com/ethul/purescript-webpack-example) for a more detailed example.
46
5163b5a2
AM
47### Options
48
7de41f10
AM
49Default options:
50
51```javascript
52{
53 psc: 'psc',
54 pscArgs: {},
55 pscBundle: 'psc-bundle',
56 pscBundleArgs: {},
5163b5a2 57 pscIde: false, // instant rebuilds using psc-ide-server (experimental)
7de41f10
AM
58 pscIdeColors: false, // defaults to true if psc === 'psa'
59 bundleOutput: 'output/bundle.js',
60 bundleNamespace: 'PS',
61 bundle: false,
62 warnings: true,
63 output: 'output',
64 src: [
65 path.join('src', '**', '*.purs'),
66 path.join('bower_components', 'purescript-*', 'src', '**', '*.purs')
2b2207bd 67 ]
7de41f10
AM
68}
69```
5163b5a2
AM
70
71### Instant rebuilds (experimental)
72
73Experimental support for instant rebuilds using `psc-ide-server` can be enabled
74via the `pscIde: true` option.