aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/PscIde.js
diff options
context:
space:
mode:
authoreric thul <thul.eric@gmail.com>2017-03-18 07:38:03 -0400
committereric thul <thul.eric@gmail.com>2017-03-18 07:38:03 -0400
commitbf1a6040f4927f862e2160db2bafd93876178a0c (patch)
tree520918b08d7ee833f69ab391f0ced8e709b43124 /src/PscIde.js
parent33bcd87e2213e8a9b1eea4be48b5c0e0e8d3ea0b (diff)
downloadpurs-loader-bf1a6040f4927f862e2160db2bafd93876178a0c.tar.gz
purs-loader-bf1a6040f4927f862e2160db2bafd93876178a0c.tar.zst
purs-loader-bf1a6040f4927f862e2160db2bafd93876178a0c.zip
Fix rebuild for ModuleNotFound
Resolves #88
Diffstat (limited to 'src/PscIde.js')
-rw-r--r--src/PscIde.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/PscIde.js b/src/PscIde.js
index b164dc2..bf92b38 100644
--- a/src/PscIde.js
+++ b/src/PscIde.js
@@ -154,11 +154,13 @@ function rebuild(psModule) {
154 .then(compileMessages => { 154 .then(compileMessages => {
155 if (res.resultType === 'error') { 155 if (res.resultType === 'error') {
156 if (res.result.some(item => { 156 if (res.result.some(item => {
157 const isModuleNotFound = item.errorCode === 'ModuleNotFound';
158
157 const isUnknownModule = item.errorCode === 'UnknownModule'; 159 const isUnknownModule = item.errorCode === 'UnknownModule';
158 160
159 const isUnknownModuleImport = item.errorCode === 'UnknownName' && /Unknown module/.test(item.message); 161 const isUnknownModuleImport = item.errorCode === 'UnknownName' && /Unknown module/.test(item.message);
160 162
161 return isUnknownModule || isUnknownModuleImport; 163 return isModuleNotFound || isUnknownModule || isUnknownModuleImport;
162 })) { 164 })) {
163 debug('unknown module, attempting full recompile') 165 debug('unknown module, attempting full recompile')
164 return Psc.compile(psModule) 166 return Psc.compile(psModule)