aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoreric thul <thul.eric@gmail.com>2017-04-23 19:02:01 -0400
committereric thul <thul.eric@gmail.com>2017-04-23 19:02:01 -0400
commit6ccb09a5950b032f7cc5e6af5a1bba29773385c8 (patch)
tree51824f3d57bd57c0139eab4c8ddf022d761f49ae
parent6d507f3a8aee01ef23da3e821e7948e2bf0080a0 (diff)
downloadpurs-loader-6ccb09a5950b032f7cc5e6af5a1bba29773385c8.tar.gz
purs-loader-6ccb09a5950b032f7cc5e6af5a1bba29773385c8.tar.zst
purs-loader-6ccb09a5950b032f7cc5e6af5a1bba29773385c8.zip
Fix requires and psc-package caching
-rw-r--r--src/ide.js2
-rw-r--r--src/index.js7
-rw-r--r--src/to-javascript.js2
3 files changed, 7 insertions, 4 deletions
diff --git a/src/ide.js b/src/ide.js
index a2ccbe3..e6a45c2 100644
--- a/src/ide.js
+++ b/src/ide.js
@@ -22,7 +22,7 @@ const dargs = require('./dargs');
22 22
23const compile = require('./compile'); 23const compile = require('./compile');
24 24
25const PsModuleMap = require('./PsModuleMap'); 25const PsModuleMap = require('./purs-module-map');
26 26
27function UnknownModuleError() { 27function UnknownModuleError() {
28 this.name = 'UnknownModuleError'; 28 this.name = 'UnknownModuleError';
diff --git a/src/index.js b/src/index.js
index f77e5f8..11b06eb 100644
--- a/src/index.js
+++ b/src/index.js
@@ -72,7 +72,10 @@ module.exports = function purescriptLoader(source, map) {
72 72
73 const cmd = spawn(pscPackageCommand, pscPackageArgs); 73 const cmd = spawn(pscPackageCommand, pscPackageArgs);
74 74
75 if (cmd.status !== 0) { 75 if (cmd.error) {
76 throw new Error(cmd.error);
77 }
78 else if (cmd.status !== 0) {
76 const error = cmd.stdout.toString(); 79 const error = cmd.stdout.toString();
77 80
78 throw new Error(error); 81 throw new Error(error);
@@ -140,7 +143,7 @@ module.exports = function purescriptLoader(source, map) {
140 compilationStarted: false, 143 compilationStarted: false,
141 compilationFinished: false, 144 compilationFinished: false,
142 installed: cache.installed, 145 installed: cache.installed,
143 srcOption: cache.srcOption 146 srcOption: []
144 }; 147 };
145 }); 148 });
146 149
diff --git a/src/to-javascript.js b/src/to-javascript.js
index d0934d5..b3e3051 100644
--- a/src/to-javascript.js
+++ b/src/to-javascript.js
@@ -16,7 +16,7 @@ const debug = debug_('purs-loader');
16 16
17const debugVerbose = debug_('purs-loader:verbose'); 17const debugVerbose = debug_('purs-loader:verbose');
18 18
19const PsModuleMap = require('./PsModuleMap'); 19const PsModuleMap = require('./purs-module-map');
20 20
21function updatePsModuleMap(psModule) { 21function updatePsModuleMap(psModule) {
22 const options = psModule.options; 22 const options = psModule.options;