Similar to the way psc-ide support works, the purs-loader now tolerates
compiler errors when the `watch` option is true. When webpack is being
run in watch mode the user can set `watch` to true in order to avoid
failing the webpack bundle creation when the PureScript compiler fails.
Resolves issue #66
Resolves issue #73
Resolves issue #74
bundleNamespace: 'PS',
bundle: false,
warnings: true,
+ watch: false, // indicates if webapck is in watch mode
output: 'output',
src: [
path.join('src', '**', '*.purs'),
if (errorMessage.length) {
psModule.emitError(errorMessage);
}
- reject(new Error('compilation failed'))
+ if (options.watch) {
+ resolve(psModule);
+ }
+ else {
+ reject(new Error('compilation failed'))
+ }
} else {
const warningMessage = stderr.join('');
if (options.warnings && warningMessage.length) {
bundleNamespace: 'PS',
bundle: false,
warnings: true,
+ watch: false,
output: 'output',
src: [
path.join('src', '**', '*.purs'),