]> git.immae.eu Git - github/fretlink/purs-loader.git/commitdiff
Fix rebuild for ModuleNotFound
authoreric thul <thul.eric@gmail.com>
Sat, 18 Mar 2017 11:38:03 +0000 (07:38 -0400)
committereric thul <thul.eric@gmail.com>
Sat, 18 Mar 2017 11:38:03 +0000 (07:38 -0400)
Resolves #88

src/PscIde.js

index b164dc2d78e55a3285c0360aac4e5a89bffe0b32..bf92b3860ee502532ee315de68e9f38323cfea0f 100644 (file)
@@ -154,11 +154,13 @@ function rebuild(psModule) {
       .then(compileMessages => {
         if (res.resultType === 'error') {
           if (res.result.some(item => {
+            const isModuleNotFound = item.errorCode === 'ModuleNotFound';
+
             const isUnknownModule = item.errorCode === 'UnknownModule';
 
             const isUnknownModuleImport = item.errorCode === 'UnknownName' && /Unknown module/.test(item.message);
 
-            return isUnknownModule || isUnknownModuleImport;
+            return isModuleNotFound || isUnknownModule || isUnknownModuleImport;
           })) {
             debug('unknown module, attempting full recompile')
             return Psc.compile(psModule)