From 6ab1eca04a11dc5d8f725b3aa8515d94b6819e4b Mon Sep 17 00:00:00 2001 From: Michal Kozakiewicz Date: Fri, 6 Jan 2017 17:18:59 +0100 Subject: Add psc-ide-server arguments and pass src to psc-ide-server --- README.md | 1 + src/PscIde.js | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9d6166b..e4f0bf0 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ Default options: pscBundleArgs: {}, pscIde: false, // instant rebuilds using psc-ide-server (experimental) pscIdeArgs: {}, // for example, to use different psc-ide-server port: {port: 4088} + pscIdeServerArgs: {}, // for example, to change the port { port: 4088 } pscIdeColors: false, // defaults to true if psc === 'psa' bundleOutput: 'output/bundle.js', bundleNamespace: 'PS', diff --git a/src/PscIde.js b/src/PscIde.js index 27b49f6..8a0e823 100644 --- a/src/PscIde.js +++ b/src/PscIde.js @@ -61,13 +61,14 @@ function connect(psModule) { ideClient.stdin.write('\n') }) - const args = dargs(Object.assign({ + const serverArgs = dargs(Object.assign({ outputDirectory: options.output, - }, options.pscIdeArgs)) + "_": options.src + }, options.pscIdeServerArgs)) - debug('attempting to start psc-ide-server', args) + debug('attempting to start psc-ide-server', serverArgs) - const ideServer = cache.ideServer = spawn('psc-ide-server', []) + const ideServer = cache.ideServer = spawn('psc-ide-server', serverArgs) ideServer.stderr.on('data', data => { debug(data.toString()) }) -- cgit v1.2.3 From 4343e0eb79b0324d7f4c4eed081780faeaa836a0 Mon Sep 17 00:00:00 2001 From: Michal Kozakiewicz Date: Mon, 9 Jan 2017 17:42:05 +0100 Subject: Add information about potentially slowing down webpack startup --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e4f0bf0..292ab85 100644 --- a/README.md +++ b/README.md @@ -72,4 +72,18 @@ Default options: Experimental support for instant rebuilds using `psc-ide-server` can be enabled via the `pscIde: true` option. -You can use an already running `psc-ide-server` instance by specifying the port in `pscIdeArgs`. +You can use an already running `psc-ide-server` instance by specifying the port in `pscIdeArgs`, +if there is no server running this loader will start one for you. + + +#### Slower webpack startup after using purs-loader ? + +By default, the psc-ide-server will be passed the globs from query.src, this is +helpful for other tools using psc-ide-server (for example IDE plugins), however +it might result in a slower initial webpack startup time (rebuilds are not +affected). To override the default behaviour, add: +`pscIdeServerArgs: { "_": ['your/*globs/here'] }` to the loader config + + + + -- cgit v1.2.3