## Install
-Install with [npm](https://npmjs.org/package/purs-loader)
+Install with [npm](https://npmjs.org/package/purs-loader).
+
+This loader works in conjunction with the [PureScript webpack plugin](https://npmjs.org/package/purescript-webpack-plugin). Ensure the plugin is installed and configured accordingly.
```
npm install purs-loader --save-dev
## Options
-###### `noPrelude` (Boolean)
-
-Toggles `--no-prelude` that omits the Prelude.
-
-###### `noTco` (Boolean)
-
-Toggles `--no-tco` that disables tail-call optimizations.
-
-###### `noMagicDo` (Boolean)
-
-Toggles `--no-magic-do` that disables optimizations overloading the do keyword generating efficient code for the `Eff` monad.
-
-###### `noOpts` (Boolean)
+###### `bundleOutput` (String)
-Toggles `--no-opts` that skips the optimization phase.
+Relative path to the bundled JavaScript file generated by the `PurescriptWebpackPlugin`. The default value is `output/bundle.js`.
-###### `verboseErrors` (Boolean)
-
-Toggles `--verbose-errors` that displays verbose error messages.
-
-###### `comments` (Boolean)
-
-Toggles `--comments` that includes comments in generated code.
+## Example
-###### `output` (String)
+```js
+// webpack.config.js
+'use strict';
-Sets `--output=<string>` the specifies the output directory, `output` by default.
+var PurescriptWebpackPlugin = require('purescript-webpack-plugin');
-###### `noPrefix` (Boolean)
+var src = ['bower_components/purescript-*/src/**/*.purs', 'src/**/*.purs'];
-Toggles `--no-prefix` that does not include the comment header.
+var ffi = ['bower_components/purescript-*/src/**/*.js', 'src/**/*FFI.js'];
-###### `src` (String Array)
+var modulesDirectories = [
+ 'node_modules',
+ 'bower_components'
+];
-Specifies PureScript source paths to be globbed for `.purs` files. By default, `bower_components` is search. Additional paths may be specified using this option. This option is specified as `src[]=path`.
+var config
+ = { entry: './src/entry'
+ , output: { path: __dirname
+ , pathinfo: true
+ , filename: 'bundle.js'
+ }
+ , module: { loaders: [ { test: /\.purs$/
+ , loader: 'purs-loader'
+ } ] }
+ , resolve: { modulesDirectories: modulesDirectories }
+ , plugins: [ new PurescriptWebpackPlugin({src: src, ffi: ffi}) ]
+ }
+ ;
-## Example
+module.exports = config;
+```
See the [example](https://github.com/ethul/purs-loader/tree/master/example) directory for a complete example.