Browse Source

passing loader context

dev
Ivan Polyakov 2 years ago
parent
commit
0af314c96d
  1. 3
      loader.js

3
loader.js

@ -9,7 +9,7 @@ const schema = { @@ -9,7 +9,7 @@ const schema = {
properties: {
expr: {
type: 'string',
default: '(use-modules (sxml simple))(sxml->xml SXML_LOADER_CONTENT)',
default: '(define loader-context \"SXML_LOADER_CONTEXT\")(use-modules (sxml simple))(sxml->xml SXML_LOADER_CONTENT)',
},
doctype: {
type: 'string',
@ -36,6 +36,7 @@ module.exports = function(content, map, meta) { @@ -36,6 +36,7 @@ module.exports = function(content, map, meta) {
if (options.expr)
expr = options.expr;
expr = expr.replace('SXML_LOADER_CONTENT', content);
expr = expr.replace('SXML_LOADER_CONTEXT', this.context + '/');
const cb = this.async();
runScheme('guile', ['-c', expr]).then(data => {

Loading…
Cancel
Save