3 > [PureScript](http://www.purescript.org) loader for [webpack](http://webpack.github.io)
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
11 Install with [npm](https://npmjs.org/package/purs-loader).
14 // For PureScript 0.9 and newer
15 npm install purs-loader --save-dev
18 npm install purs-loader@purescript-0.8 --save-dev
24 const webpackConfig = {
30 loader: 'purs-loader',
31 exclude: /node_modules/,
34 src: ['bower_components/purescript-*/src/**/*.purs', 'src/**/*.purs']
43 Refer to the [purescript-webpack-example](https://github.com/ethul/purescript-webpack-example) for a more detailed example.
50 const loaderConfig = {
53 pscBundle: 'psc-bundle',
55 pscIde: false, // instant rebuilds using psc-ide-server (experimental)
56 pscIdeArgs: {}, // for example, to use different psc-ide-server port: {port: 4088}
57 pscIdeServerArgs: {}, // for example, to change the port { port: 4088 }
58 pscIdeColors: false, // defaults to true if psc === 'psa'
60 bundleOutput: 'output/bundle.js',
61 bundleNamespace: 'PS',
66 path.join('src', '**', '*.purs'),
67 // if pscPackage = false
68 path.join('bower_components', 'purescript-*', 'src', '**', '*.purs')
69 // if pscPackage = true
70 // source paths reported by `psc-package sources`
75 ### `psc-ide` support (experimental)
77 Experimental support for instant rebuilds using `psc-ide-server` can be enabled
78 via the `pscIde: true` option.
79 You can use an already running `psc-ide-server` instance by specifying the port in `pscIdeArgs`,
80 if there is no server running this loader will start one for you.
83 #### Slower webpack startup after using purs-loader ?
85 By default, the psc-ide-server will be passed the globs from query.src, this is
86 helpful for other tools using psc-ide-server (for example IDE plugins), however
87 it might result in a slower initial webpack startup time (rebuilds are not
88 affected). To override the default behaviour, add:
89 `pscIdeServerArgs: { "_": ['your/*globs/here'] }` to the loader config
91 ### `psc-package` support (experimental)
93 Set `pscPackage` query parameter to `true` to enable `psc-package` support. The `psc-package`-supplied source paths
94 will be appended to `src` parameter.