aboutsummaryrefslogtreecommitdiffhomepage
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md49
1 files changed, 45 insertions, 4 deletions
diff --git a/README.md b/README.md
index 3b31354..c15f03c 100644
--- a/README.md
+++ b/README.md
@@ -61,6 +61,7 @@ const loaderConfig = {
61 bundleNamespace: 'PS', 61 bundleNamespace: 'PS',
62 bundle: false, 62 bundle: false,
63 warnings: true, 63 warnings: true,
64 watch: false, // indicates if webpack is in watch mode
64 output: 'output', 65 output: 'output',
65 src: [ 66 src: [
66 path.join('src', '**', '*.purs'), 67 path.join('src', '**', '*.purs'),
@@ -79,8 +80,14 @@ via the `pscIde: true` option.
79You can use an already running `psc-ide-server` instance by specifying the port in `pscIdeArgs`, 80You can use an already running `psc-ide-server` instance by specifying the port in `pscIdeArgs`,
80if there is no server running this loader will start one for you. 81if there is no server running this loader will start one for you.
81 82
83### `psc-package` support (experimental)
84
85Set `pscPackage` query parameter to `true` to enable `psc-package` support. The `psc-package`-supplied source paths
86will be appended to `src` parameter.
87
88### Troubleshooting
82 89
83#### Slower webpack startup after using purs-loader ? 90#### Slower webpack startup after enabling psc-ide support?
84 91
85By default, the psc-ide-server will be passed the globs from query.src, this is 92By default, the psc-ide-server will be passed the globs from query.src, this is
86helpful for other tools using psc-ide-server (for example IDE plugins), however 93helpful for other tools using psc-ide-server (for example IDE plugins), however
@@ -88,7 +95,41 @@ it might result in a slower initial webpack startup time (rebuilds are not
88affected). To override the default behaviour, add: 95affected). To override the default behaviour, add:
89`pscIdeServerArgs: { "_": ['your/*globs/here'] }` to the loader config 96`pscIdeServerArgs: { "_": ['your/*globs/here'] }` to the loader config
90 97
91### `psc-package` support (experimental) 98#### Errors not being displayed in watch mode?
92 99
93Set `pscPackage` query parameter to `true` to enable `psc-package` support. The `psc-package`-supplied source paths 100When the `watch` option is set to `true`, psc errors are appended to
94will be appended to `src` parameter. 101webpack's compilation instance errors array and not passed back as an
102error to the loader's callback. This may result in the error not being
103reported by webpack. To display errors, the following plugin may be added
104to the webpack config.
105
106```javascript
107const webpackConfig = {
108 // ...
109 plugins: [
110 function(){
111 this.plugin('done', function(stats){
112 process.stderr.write(stats.toString('errors-only'));
113 });
114 }
115 ]
116 // ...
117}
118```
119
120#### Error `spawn ENOENT`
121
122This is caused when the loader tries to spawn a binary that does not exists
123(`file or directory not found`). If you call webpack like `webpack` or
124`webpack --watch`, then ensure that all required binaries that the
125loader depends on are available in your `$PATH`.
126
127If you run webpack through an npm script (e.g., npm run or npm start) on NixOS,
128then it will first attempt to find binaries in `node_packages/.bin`.
129If you have the compiler installed through `npm` and it finds it there, this will
130cause `ENOENT`on Nix, because [the binary needs to be patched first, but npm will
131install the binary that is linked with /lib64/ld-linux-x86-64.so.2 - a file that
132will not exist at that path in NixOS](https://github.com/ethul/purescript-webpack-example/issues/5#issuecomment-282492131).
133The solution is to simply use the compiler from `haskellPackages.purescript` and
134make sure that it's available in `$PATH`. For more information about how to make
135it work on Nix, see [Purescript Webpack Example](https://github.com/ethul/purescript-webpack-example#using-globally-installed-binaries)