Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const fs = require('fs');
const path = require('path');
const exec = require('child_process').exec;
const tmp = require('tmp');
const hash = require('hash-sum');
const split = require('haxe-modular/tool/bin/split');
const hooks = require('haxe-modular/bin/hooks');
const tokenize = require('yargs-parser/lib/tokenize-arg-string');
const haxeErrorParser = require('haxe-error-parser');
const problemMatcher = haxeErrorParser.problemMatcher;
const identifyError = haxeErrorParser.identifyError;
const cache = Object.create(null);
// resolve hooks once
const graphHooks = hooks.getGraphHooks();
module.exports = function(hxmlContent) {
const context = this;
const options = loaderUtils.getOptions(context) || {};
context.cacheable && context.cacheable();
const cb = context.async();
const request = context.resourcePath;
if (!request) {
// Loader was called without specifying a hxml file
// Expecting a require of the form '!haxe-loader?hxmlName/moduleName!'
fromCache(context, context.query, cb);
return;
}
const ns = path.basename(request).replace('.hxml', '');