aboutsummaryrefslogtreecommitdiffhomepage
path: root/README.md
diff options
context:
space:
mode:
authorAlex Mingoia <talk@alexmingoia.com>2016-05-10 00:09:28 -0700
committerAlex Mingoia <talk@alexmingoia.com>2016-05-10 00:09:28 -0700
commit7de41f10b4ff0f0d6b45d59bee0f166c3cfe3f9f (patch)
tree9ee160ba5b7dab900ccd1cfa657760e4103a175e /README.md
parent777472b3830cb3d2ff3390003ea422c6d4522715 (diff)
downloadpurs-loader-7de41f10b4ff0f0d6b45d59bee0f166c3cfe3f9f.tar.gz
purs-loader-7de41f10b4ff0f0d6b45d59bee0f166c3cfe3f9f.tar.zst
purs-loader-7de41f10b4ff0f0d6b45d59bee0f166c3cfe3f9f.zip
Refactor to compile independently of purescript-webpack-plugin.
- Remove dependence on purescript-webpack-plugin - Fixes double-compilation issue by loading compiled JS instead of adding dependency. - Uses `psc-ide-server` for fast rebuilds.
Diffstat (limited to 'README.md')
-rw-r--r--README.md52
1 files changed, 49 insertions, 3 deletions
diff --git a/README.md b/README.md
index df92e69..ed25296 100644
--- a/README.md
+++ b/README.md
@@ -2,16 +2,62 @@
2 2
3> [PureScript](http://www.purescript.org) loader for [webpack](http://webpack.github.io) 3> [PureScript](http://www.purescript.org) loader for [webpack](http://webpack.github.io)
4 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
5## Install 9## Install
6 10
7Install with [npm](https://npmjs.org/package/purs-loader). 11Install with [npm](https://npmjs.org/package/purs-loader).
8 12
9This loader works in conjunction with the [PureScript webpack plugin](https://npmjs.org/package/purescript-webpack-plugin). Ensure the plugin is installed and configured accordingly.
10
11``` 13```
12npm install purs-loader --save-dev 14npm install purs-loader --save-dev
13``` 15```
14 16
15## Example 17## Example
16 18
17Refer to the [purescript-webpack-example](https://github.com/ethul/purescript-webpack-example) for an example. 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
40Default options:
41
42```javascript
43{
44 psc: 'psc',
45 pscArgs: {},
46 pscBundle: 'psc-bundle',
47 pscBundleArgs: {},
48 pscIdeColors: false, // defaults to true if psc === 'psa'
49 bundleOutput: 'output/bundle.js',
50 bundleNamespace: 'PS',
51 bundle: false,
52 warnings: true,
53 output: 'output',
54 src: [
55 path.join('src', '**', '*.purs'),
56 path.join('bower_components', 'purescript-*', 'src', '**', '*.purs')
57 ],
58 ffi: [
59 path.join('src', '**', '*.js'),
60 path.join('bower_components', 'purescript-*', 'src', '**', '*.js')
61 ],
62}
63```