diff options
author | eric thul <thul.eric@gmail.com> | 2017-02-20 17:56:56 -0500 |
---|---|---|
committer | eric thul <thul.eric@gmail.com> | 2017-02-20 17:56:56 -0500 |
commit | 03f52cb367cc8f1e57c515e4ac61c49cb72773eb (patch) | |
tree | ba01c92c27497d136b7fc7c3e77b2815b6f38662 /README.md | |
parent | d146844d2e98aa08730bebd1f14a2bafb3cde1cf (diff) | |
download | purs-loader-03f52cb367cc8f1e57c515e4ac61c49cb72773eb.tar.gz purs-loader-03f52cb367cc8f1e57c515e4ac61c49cb72773eb.tar.zst purs-loader-03f52cb367cc8f1e57c515e4ac61c49cb72773eb.zip |
Update README for error reporting
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 31 |
1 files changed, 27 insertions, 4 deletions
@@ -80,8 +80,14 @@ via the `pscIde: true` option. | |||
80 | You can use an already running `psc-ide-server` instance by specifying the port in `pscIdeArgs`, | 80 | You can use an already running `psc-ide-server` instance by specifying the port in `pscIdeArgs`, |
81 | if there is no server running this loader will start one for you. | 81 | if there is no server running this loader will start one for you. |
82 | 82 | ||
83 | ### `psc-package` support (experimental) | ||
84 | |||
85 | Set `pscPackage` query parameter to `true` to enable `psc-package` support. The `psc-package`-supplied source paths | ||
86 | will be appended to `src` parameter. | ||
87 | |||
88 | ### Troubleshooting | ||
83 | 89 | ||
84 | #### Slower webpack startup after using purs-loader ? | 90 | #### Slower webpack startup after enabling psc-ide support? |
85 | 91 | ||
86 | By default, the psc-ide-server will be passed the globs from query.src, this is | 92 | By default, the psc-ide-server will be passed the globs from query.src, this is |
87 | helpful for other tools using psc-ide-server (for example IDE plugins), however | 93 | helpful for other tools using psc-ide-server (for example IDE plugins), however |
@@ -89,7 +95,24 @@ it might result in a slower initial webpack startup time (rebuilds are not | |||
89 | affected). To override the default behaviour, add: | 95 | affected). To override the default behaviour, add: |
90 | `pscIdeServerArgs: { "_": ['your/*globs/here'] }` to the loader config | 96 | `pscIdeServerArgs: { "_": ['your/*globs/here'] }` to the loader config |
91 | 97 | ||
92 | ### `psc-package` support (experimental) | 98 | #### Errors not being displayed in watch mode? |
93 | 99 | ||
94 | Set `pscPackage` query parameter to `true` to enable `psc-package` support. The `psc-package`-supplied source paths | 100 | When the `watch` option is set to `true`, psc errors are appended to |
95 | will be appended to `src` parameter. | 101 | webpack's compilation instance errors array and not passed back as an |
102 | error to the loader's callback. This may result in the error not being | ||
103 | reported by webpack. To display errors, the following plugin may be added | ||
104 | to the webpack config. | ||
105 | |||
106 | ```javascript | ||
107 | const 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 | ``` | ||