From 6ccb09a5950b032f7cc5e6af5a1bba29773385c8 Mon Sep 17 00:00:00 2001 From: eric thul Date: Sun, 23 Apr 2017 19:02:01 -0400 Subject: Fix requires and psc-package caching --- src/ide.js | 2 +- src/index.js | 7 +++++-- src/to-javascript.js | 2 +- 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'); const compile = require('./compile'); -const PsModuleMap = require('./PsModuleMap'); +const PsModuleMap = require('./purs-module-map'); function UnknownModuleError() { 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) { const cmd = spawn(pscPackageCommand, pscPackageArgs); - if (cmd.status !== 0) { + if (cmd.error) { + throw new Error(cmd.error); + } + else if (cmd.status !== 0) { const error = cmd.stdout.toString(); throw new Error(error); @@ -140,7 +143,7 @@ module.exports = function purescriptLoader(source, map) { compilationStarted: false, compilationFinished: false, installed: cache.installed, - srcOption: cache.srcOption + srcOption: [] }; }); 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'); const debugVerbose = debug_('purs-loader:verbose'); -const PsModuleMap = require('./PsModuleMap'); +const PsModuleMap = require('./purs-module-map'); function updatePsModuleMap(psModule) { const options = psModule.options; -- cgit v1.2.3