diff options
author | eric thul <thul.eric@gmail.com> | 2016-11-19 12:47:18 -0500 |
---|---|---|
committer | eric thul <thul.eric@gmail.com> | 2016-11-19 12:47:18 -0500 |
commit | 514ab14654d5809c2485455c875471328238d102 (patch) | |
tree | d7fa17c3413f377dfcf70572e07f9d7a11aa4725 | |
parent | df05d7e1e854b318fc74f33ca701ed521fd3a5ce (diff) | |
download | purs-loader-514ab14654d5809c2485455c875471328238d102.tar.gz purs-loader-514ab14654d5809c2485455c875471328238d102.tar.zst purs-loader-514ab14654d5809c2485455c875471328238d102.zip |
Update debug statements during build/bundle
-rw-r--r-- | src/Psc.js | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -29,7 +29,7 @@ function compile(psModule) { | |||
29 | debug('spawning compiler %s %o', options.psc, args) | 29 | debug('spawning compiler %s %o', options.psc, args) |
30 | 30 | ||
31 | return (new Promise((resolve, reject) => { | 31 | return (new Promise((resolve, reject) => { |
32 | debug('\nCompiling PureScript...') | 32 | debug('compiling PureScript...') |
33 | 33 | ||
34 | const compilation = spawn(options.psc, args) | 34 | const compilation = spawn(options.psc, args) |
35 | 35 | ||
@@ -37,7 +37,7 @@ function compile(psModule) { | |||
37 | compilation.stderr.on('data', data => stderr.push(data.toString())) | 37 | compilation.stderr.on('data', data => stderr.push(data.toString())) |
38 | 38 | ||
39 | compilation.on('close', code => { | 39 | compilation.on('close', code => { |
40 | debug('Finished compiling PureScript.') | 40 | debug('finished compiling PureScript.') |
41 | cache.compilationFinished = true | 41 | cache.compilationFinished = true |
42 | if (code !== 0) { | 42 | if (code !== 0) { |
43 | cache.errors = stderr.join('') | 43 | cache.errors = stderr.join('') |
@@ -74,13 +74,14 @@ function bundle(options, cache) { | |||
74 | debug('spawning bundler %s %o', options.pscBundle, args.join(' ')) | 74 | debug('spawning bundler %s %o', options.pscBundle, args.join(' ')) |
75 | 75 | ||
76 | return (new Promise((resolve, reject) => { | 76 | return (new Promise((resolve, reject) => { |
77 | debug('Bundling PureScript...') | 77 | debug('bundling PureScript...') |
78 | 78 | ||
79 | const compilation = spawn(options.pscBundle, args) | 79 | const compilation = spawn(options.pscBundle, args) |
80 | 80 | ||
81 | compilation.stdout.on('data', data => stdout.push(data.toString())) | 81 | compilation.stdout.on('data', data => stdout.push(data.toString())) |
82 | compilation.stderr.on('data', data => stderr.push(data.toString())) | 82 | compilation.stderr.on('data', data => stderr.push(data.toString())) |
83 | compilation.on('close', code => { | 83 | compilation.on('close', code => { |
84 | debug('finished bundling PureScript.') | ||
84 | if (code !== 0) { | 85 | if (code !== 0) { |
85 | cache.errors = (cache.errors || '') + stderr.join('') | 86 | cache.errors = (cache.errors || '') + stderr.join('') |
86 | return reject(new Error('bundling failed')) | 87 | return reject(new Error('bundling failed')) |