Browse Source

build process fixed from stopping when guile is compiling modules and writing logs to stderr

pull/4/head
Ivan Polyakov 2 years ago
parent
commit
73c424d5ad
  1. 11
      loader.js
  2. 2
      package.json

11
loader.js

@ -32,12 +32,13 @@ module.exports = function(content, map, meta) { @@ -32,12 +32,13 @@ module.exports = function(content, map, meta) {
if (options.expr)
expr = options.expr;
expr = expr.replace('SXML_LOADER_CONTENT', content);
chdir(this.rootContext);
const cb = this.async();
runScheme('guile', ['-c', expr]).then(data => {
cb(null, `${doctype}\n${data}`, map, meta);
}).catch(err => {
console.error(err);
}).catch(code => {
console.error(`Guile exited with code ${code}`);
});
}
@ -49,7 +50,11 @@ function runScheme(interpreter, flags) { @@ -49,7 +50,11 @@ function runScheme(interpreter, flags) {
resolve(data);
});
scheme.stderr.on('data', (data) => {
reject(data.toString());
console.error(data.toString());
});
scheme.on('exit', (code) => {
if (code)
reject(code);
});
});
}

2
package.json

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
{
"name": "sxml-loader",
"version": "0.3.0",
"version": "0.3.1",
"description": "Scheme XML loader for webpack",
"main": "loader.js",
"bugs": "http://git.vilor.one/vilor/sxml-loader/issues",

Loading…
Cancel
Save