How to use the componentsjs.compileConfig function in componentsjs

To help you get started, we’ve selected a few componentsjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github comunica / comunica / packages / runner / bin / compile-config.ts View on Github external
const configStreamRaw: Stream = createReadStream(configPath, { encoding: 'utf8' });
let exportVariableName: string = 'urn:comunica:sparqlinit';
if (args.length > 1) {
  exportVariableName = args[1];
}

// Hack our require path so that compilation in a monorepo dev environment always works properly
// Otherwise, Components.js will think that we are running inside the 'runner' package,
// and it will use its node_modules.
require.main.paths = [];
const pathParts = mainModulePath.split(sep);
for (let i = pathParts.length; i > 0; i--) {
  require.main.paths.push(pathParts.slice(0, i).join(sep) + sep + 'node_modules');
}

compileConfig({ mainModulePath }, configPath, configStreamRaw, configResourceUri, exportVariableName)
  .then(console.log).catch((e) => {
    console.error(e);
    process.exit(1);
  });

componentsjs

A semantic dependency injection framework

MIT
Latest version published 29 days ago

Package Health Score

65 / 100
Full package analysis

Popular componentsjs functions