]>
Commit | Line | Data |
---|---|---|
a42f24b8 | 1 | # purs-loader |
2 | ||
08b34471 | 3 | > [PureScript](http://www.purescript.org) loader for [webpack](http://webpack.github.io) |
a42f24b8 | 4 | |
5 | ## Install | |
6 | ||
7 | Install with [npm](https://npmjs.org/package/purs-loader) | |
8 | ||
9 | ``` | |
10 | npm install purs-loader --save-dev | |
11 | ``` | |
12 | ||
13 | ## Options | |
14 | ||
a42f24b8 | 15 | - **no-prelude**: Boolean value that toggles `--no-prelude` |
16 | - Do not include the Prelude in the generated Javascript. | |
17 | - **no-opts**: Boolean value that toggles `--no-opts` | |
18 | - Disable all optimizations. | |
19 | - **no-magic-do**: Boolean value that toggles `--no-magic-do` | |
20 | - Turn off optimizations which inline calls to >>= for the Eff monad. | |
21 | - **no-tco**: Boolean value that toggles `--no-tco` | |
22 | - Turn off tail-call elimination. | |
a42f24b8 | 23 | - **verbose-errors**: Boolean value that toggles `--verbose-errors` |
24 | - Generate verbose error messages. | |
25 | - **output**: String value that sets `--output=<string>` | |
26 | - Write the generated Javascript to the specified file. | |
27 | ||
28 | ## Example | |
29 | ||
30 | ```js | |
31 | var path = require('path'); | |
32 | ||
33 | module.exports = { | |
34 | entry: './src/test', | |
35 | output: { | |
36 | path: path.join(__dirname, 'dist'), | |
37 | filename: 'app.js' | |
38 | }, | |
39 | module: { | |
40 | loaders: [{ | |
41 | test: /\.purs$/, | |
42 | loader: 'purs-loader?no-prelude&output=output' | |
43 | }] | |
44 | }, | |
45 | resolve: { | |
46 | modulesDirectories: [ | |
47 | 'node_modules', | |
48 | 'web_modules', | |
49 | 'output' | |
50 | ] | |
51 | } | |
52 | }; | |
53 | ``` |