diff options
author | eric thul <thul.eric@gmail.com> | 2017-04-23 19:02:01 -0400 |
---|---|---|
committer | eric thul <thul.eric@gmail.com> | 2017-04-23 19:02:01 -0400 |
commit | 6ccb09a5950b032f7cc5e6af5a1bba29773385c8 (patch) | |
tree | 51824f3d57bd57c0139eab4c8ddf022d761f49ae /src | |
parent | 6d507f3a8aee01ef23da3e821e7948e2bf0080a0 (diff) | |
download | purs-loader-6ccb09a5950b032f7cc5e6af5a1bba29773385c8.tar.gz purs-loader-6ccb09a5950b032f7cc5e6af5a1bba29773385c8.tar.zst purs-loader-6ccb09a5950b032f7cc5e6af5a1bba29773385c8.zip |
Fix requires and psc-package caching
Diffstat (limited to 'src')
-rw-r--r-- | src/ide.js | 2 | ||||
-rw-r--r-- | src/index.js | 7 | ||||
-rw-r--r-- | src/to-javascript.js | 2 |
3 files changed, 7 insertions, 4 deletions
@@ -22,7 +22,7 @@ const dargs = require('./dargs'); | |||
22 | 22 | ||
23 | const compile = require('./compile'); | 23 | const compile = require('./compile'); |
24 | 24 | ||
25 | const PsModuleMap = require('./PsModuleMap'); | 25 | const PsModuleMap = require('./purs-module-map'); |
26 | 26 | ||
27 | function UnknownModuleError() { | 27 | function 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 | ||
17 | const debugVerbose = debug_('purs-loader:verbose'); | 17 | const debugVerbose = debug_('purs-loader:verbose'); |
18 | 18 | ||
19 | const PsModuleMap = require('./PsModuleMap'); | 19 | const PsModuleMap = require('./purs-module-map'); |
20 | 20 | ||
21 | function updatePsModuleMap(psModule) { | 21 | function updatePsModuleMap(psModule) { |
22 | const options = psModule.options; | 22 | const options = psModule.options; |