diff options
author | eric thul <thul.eric@gmail.com> | 2017-04-24 21:04:49 -0400 |
---|---|---|
committer | eric thul <thul.eric@gmail.com> | 2017-04-24 21:04:49 -0400 |
commit | 71a96808ac8a7c1ba8cb9c78b649d7f6e6530a95 (patch) | |
tree | 6588d26c44642b1d2ad1e1ee792dc894cb9668d4 | |
parent | 4dd301a2303cfab9c504528e6b8cacbdc0b25fb1 (diff) | |
download | purs-loader-71a96808ac8a7c1ba8cb9c78b649d7f6e6530a95.tar.gz purs-loader-71a96808ac8a7c1ba8cb9c78b649d7f6e6530a95.tar.zst purs-loader-71a96808ac8a7c1ba8cb9c78b649d7f6e6530a95.zip |
Add options for ide commands
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | src/ide.js | 8 | ||||
-rw-r--r-- | src/index.js | 5 |
3 files changed, 11 insertions, 6 deletions
@@ -56,7 +56,9 @@ const loaderConfig = { | |||
56 | pscBundle: null, // purs bundle | 56 | pscBundle: null, // purs bundle |
57 | pscBundleArgs: {}, | 57 | pscBundleArgs: {}, |
58 | pscIde: false, // instant rebuilds using psc-ide-server (experimental) | 58 | pscIde: false, // instant rebuilds using psc-ide-server (experimental) |
59 | pscIdeArgs: {}, // for example, to use different psc-ide-server port: {port: 4088} | 59 | pscIdeClient: null, // purs ide client |
60 | pscIdeClientArgs: {}, // for example, to use different port {port: 4088} | ||
61 | pscIdeServer: null, // purs ide server | ||
60 | pscIdeServerArgs: {}, // for example, to change the port { port: 4088 } | 62 | pscIdeServerArgs: {}, // for example, to change the port { port: 4088 } |
61 | pscIdeColors: false, // defaults to true if psc === 'psa' | 63 | pscIdeColors: false, // defaults to true if psc === 'psa' |
62 | pscPackage: false, | 64 | pscPackage: false, |
@@ -36,9 +36,9 @@ UnknownModuleError.prototype.constructor = UnknownModuleError; | |||
36 | module.exports.UnknownModuleError = UnknownModuleError; | 36 | module.exports.UnknownModuleError = UnknownModuleError; |
37 | 37 | ||
38 | function spawnIdeClient(body, options) { | 38 | function 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) { | |||
144 | module.exports.connect = function connect(psModule) { | 144 | module.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', |