aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authoreric thul <thul.eric@gmail.com>2017-04-24 21:04:49 -0400
committereric thul <thul.eric@gmail.com>2017-04-24 21:04:49 -0400
commit71a96808ac8a7c1ba8cb9c78b649d7f6e6530a95 (patch)
tree6588d26c44642b1d2ad1e1ee792dc894cb9668d4 /src
parent4dd301a2303cfab9c504528e6b8cacbdc0b25fb1 (diff)
downloadpurs-loader-71a96808ac8a7c1ba8cb9c78b649d7f6e6530a95.tar.gz
purs-loader-71a96808ac8a7c1ba8cb9c78b649d7f6e6530a95.tar.zst
purs-loader-71a96808ac8a7c1ba8cb9c78b649d7f6e6530a95.zip
Add options for ide commands
Diffstat (limited to 'src')
-rw-r--r--src/ide.js8
-rw-r--r--src/index.js5
2 files changed, 8 insertions, 5 deletions
diff --git a/src/ide.js b/src/ide.js
index e6a45c2..00de55b 100644
--- a/src/ide.js
+++ b/src/ide.js
@@ -36,9 +36,9 @@ UnknownModuleError.prototype.constructor = UnknownModuleError;
36module.exports.UnknownModuleError = UnknownModuleError; 36module.exports.UnknownModuleError = UnknownModuleError;
37 37
38function spawnIdeClient(body, options) { 38function spawnIdeClient(body, options) {
39 const ideClientCommand = 'purs'; 39 const ideClientCommand = options.pscIdeClient || 'purs';
40 40
41 const ideClientArgs = ['ide', 'client'].concat(dargs(options.pscIdeArgs)); 41 const ideClientArgs = (options.pscIdeClient ? [] : ['ide', 'client']).concat(dargs(options.pscIdeClientArgs));
42 42
43 const stderr = []; 43 const stderr = [];
44 44
@@ -144,9 +144,9 @@ function formatIdeResult(result, options, index, length) {
144module.exports.connect = function connect(psModule) { 144module.exports.connect = function connect(psModule) {
145 const options = psModule.options 145 const options = psModule.options
146 146
147 const serverCommand = 'purs'; 147 const serverCommand = options.pscIdeServer || 'purs';
148 148
149 const serverArgs = ['ide', 'server'].concat(dargs(Object.assign({ 149 const serverArgs = (options.pscIdeServer ? [] : ['ide', 'server']).concat(dargs(Object.assign({
150 outputDirectory: options.output, 150 outputDirectory: options.output,
151 '_': options.src 151 '_': options.src
152 }, options.pscIdeServerArgs))); 152 }, options.pscIdeServerArgs)));
diff --git a/src/index.js b/src/index.js
index 11b06eb..4c5abd2 100644
--- a/src/index.js
+++ b/src/index.js
@@ -108,9 +108,12 @@ module.exports = function purescriptLoader(source, map) {
108 pscArgs: {}, 108 pscArgs: {},
109 pscBundle: null, 109 pscBundle: null,
110 pscBundleArgs: {}, 110 pscBundleArgs: {},
111 pscIdeClient: null,
112 pscIdeClientArgs: {},
113 pscIdeServer: null,
114 pscIdeServerArgs: {},
111 pscIde: false, 115 pscIde: false,
112 pscIdeColors: loaderOptions.psc === 'psa', 116 pscIdeColors: loaderOptions.psc === 'psa',
113 pscIdeArgs: {},
114 pscPackage: false, 117 pscPackage: false,
115 bundleOutput: 'output/bundle.js', 118 bundleOutput: 'output/bundle.js',
116 bundleNamespace: 'PS', 119 bundleNamespace: 'PS',