3 > [PureScript](http://www.purescript.org) loader for [webpack](http://webpack.github.io)
7 Install with [npm](https://npmjs.org/package/purs-loader)
10 npm install purs-loader --save-dev
15 ###### `noPrelude` (Boolean)
17 Toggles `--no-prelude` that omits the Prelude.
19 ###### `noTco` (Boolean)
21 Toggles `--no-tco` that disables tail-call optimizations.
23 ###### `noMagicDo` (Boolean)
25 Toggles `--no-magic-do` that disables optimizations overloading the do keyword generating efficient code for the `Eff` monad.
27 ###### `noOpts` (Boolean)
29 Toggles `--no-opts` that skips the optimization phase.
31 ###### `verboseErrors` (Boolean)
33 Toggles `--verbose-errors` that displays verbose error messages.
35 ###### `comments` (Boolean)
37 Toggles `--comments` that includes comments in generated code.
39 ###### `output` (String)
41 Sets `--output=<string>` the specifies the output directory, `output` by default.
43 ###### `noPrefix` (Boolean)
45 Toggles `--no-prefix` that does not include the comment header.
47 ###### `requirePath` (String)
49 Sets `--require-path=<string>` that specifies the path prefix to use for `require()` calls in the generated JavaScript.
51 ###### `ffi` (String Array)
53 Specifies the PureScript FFI files setting `--ffi=<string>`. Glob syntax is supported. This option is specified as `ffi[]=path`.
55 ###### `src` (String Array)
57 Specifies the PureScript source files. Glob syntax is supported. This option is specified as `src[]=path`.
64 var path = require('path');
66 var srcs = ['src[]=bower_components/purescript-*/src/**/*.purs', 'src[]=src/**/*.purs'];
68 var ffis = ['ffi[]=bower_components/purescript-*/src/**/*.js'];
70 var output = 'output';
72 var modulesDirectories = [
74 // The bower component for purescript-prelude is specified here to
75 // allow JavaScript files to require the 'Prelude' module globally.
76 'bower_components/purescript-prelude/src',
77 // The output directory is specified here to allow PureScript files in
78 // your source to import other PureScript modules in your source.
83 = { entry: './src/entry'
84 , output: { path: __dirname
86 , filename: 'bundle.js'
88 , module: { loaders: [ { test: /\.purs$/
89 , loader: 'purs-loader?output=' + output + '&' + srcs.concat(ffis).join('&')
91 , resolve: { modulesDirectories: modulesDirectories
92 , extensions: ['', '.js', '.purs']
94 , resolveLoader: { root: path.join(__dirname, 'node_modules') }
98 module.exports = config;
101 See the [example](https://github.com/ethul/purs-loader/tree/master/example) directory for a complete example.
105 A `.psci` file is generated during each run of the loader.