diff options
author | eric <thul.eric@gmail.com> | 2017-02-25 10:30:44 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-25 10:30:44 -0500 |
commit | 936a04b591f649dbff2a65bbbd291913fc42502d (patch) | |
tree | b426fce8d295591d60ce94c54a157a324e100ffb /README.md | |
parent | a3c358f80f8197d5a1d05e42916cd5593b5b2dd5 (diff) | |
parent | 806d2915e6579d3dce38de8f2b40b85466ceda05 (diff) | |
download | purs-loader-936a04b591f649dbff2a65bbbd291913fc42502d.tar.gz purs-loader-936a04b591f649dbff2a65bbbd291913fc42502d.tar.zst purs-loader-936a04b591f649dbff2a65bbbd291913fc42502d.zip |
Merge pull request #84 from ethul/topic/error-handling
Topic/error handling
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 32 |
1 files changed, 28 insertions, 4 deletions
@@ -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. | |||
79 | 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`, |
80 | 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. |
81 | 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 | ||
82 | 89 | ||
83 | #### Slower webpack startup after using purs-loader ? | 90 | #### Slower webpack startup after enabling psc-ide support? |
84 | 91 | ||
85 | 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 |
86 | 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 |
@@ -88,7 +95,24 @@ it might result in a slower initial webpack startup time (rebuilds are not | |||
88 | affected). To override the default behaviour, add: | 95 | affected). 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 | ||
93 | 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 |
94 | 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 | ``` | ||