From cd1249993b209ad35b2d579b514aa74a2516cb16 Mon Sep 17 00:00:00 2001 From: eric Date: Sun, 20 Jan 2019 15:32:26 -0500 Subject: [PATCH] Sourcemaps for ide rebuild (#118) Resolves #116 --- README.md | 3 ++- src/ide.js | 4 ++-- src/index.js | 3 +-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 034dac0..cc4373e 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,8 @@ const loaderConfig = { pscIdeClient: null, // purs ide client pscIdeClientArgs: {}, // for example, to use different port {port: 4088} pscIdeServer: null, // purs ide server - pscIdeServerArgs: {}, // for example, to change the port { port: 4088 } + pscIdeServerArgs: {}, // for example, to change the port {port: 4088} + pscIdeRebuildArgs: {} // for example, for sourcemaps {codegen: ['js', 'sourcemaps']} pscIdeColors: false, // defaults to true if psc === 'psa' pscPackage: false, bundleOutput: 'output/bundle.js', diff --git a/src/ide.js b/src/ide.js index 00de55b..d3707a4 100644 --- a/src/ide.js +++ b/src/ide.js @@ -202,9 +202,9 @@ module.exports.rebuild = function rebuild(psModule) { const body = { command: 'rebuild', - params: { + params: Object.assign({ file: psModule.srcPath, - } + }, options.pscIdeRebuildArgs) }; const parseResponse = response => { diff --git a/src/index.js b/src/index.js index cc779f7..13bc5ae 100644 --- a/src/index.js +++ b/src/index.js @@ -24,8 +24,6 @@ const toJavaScript = require('./to-javascript'); const sourceMaps = require('./source-maps'); -const dargs = require('./dargs'); - const spawn = require('cross-spawn').sync const eol = require('os').EOL @@ -114,6 +112,7 @@ module.exports = function purescriptLoader(source, map) { pscIdeClientArgs: {}, pscIdeServer: null, pscIdeServerArgs: {}, + pscIdeRebuildArgs: {}, pscIde: false, pscIdeColors: loaderOptions.psc === 'psa', pscPackage: false, -- 2.41.0