Browse Source

Merge pull request 'some improvements' (#4) from dev into master

Reviewed-on: #4
master
vilor 2 years ago
parent
commit
d032b9e15e
  1. 1
      .npmignore
  2. 3
      README.md
  3. 11
      loader.js
  4. 2
      package.json

1
.npmignore

@ -1,2 +1,3 @@ @@ -1,2 +1,3 @@
dist
example
.drone.yml

3
README.md

@ -1,7 +1,8 @@ @@ -1,7 +1,8 @@
sxml-loader
===========
[![Build Status](http://drone.vilor.one/api/badges/vilor/sxml-loader/status.svg)](http://drone.vilor.one/vilor/sxml-loader)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![Build status](http://drone.vilor.one/api/badges/vilor/sxml-loader/status.svg)](http://drone.vilor.one/vilor/sxml-loader)
[![Package version](https://img.shields.io/npm/v/sxml-loader)](https://npmjs.com/sxml-loader)
<div align="center">
<img width="100" height="100" alt="Scheme"

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