Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function AssemblyScriptLoader(source) {
var options4me = loaderUtils.getOptions(this) || {};
var innerCallback = this.async();
validateOptions(require("./options"), options4me, "URL Loader");
if (this.cacheable) {
this.cacheable();
}
var me = this;
var targetPath = this._compiler.outputPath;
var buildTempPath = path.join(this._compiler.context,"/temp/assembly/");
targetPath = path.join(
buildTempPath, path.parse(this.resourcePath).name + ".wasm"
);
mkdirsSync(buildTempPath);
asc.main(
[
path.relative(process.cwd(), this.resourcePath),
// "./src/view/index/ass/test.ts",
"-o",
path.relative(process.cwd(), targetPath),
"--optimize",
"--validate",
"--sourceMap"
],
function(err) {
if (err) throw err;
var distStates = fs.statSync(targetPath);
var distFile = fs.readFileSync(targetPath);
// Options `dataUrlLimit` is backward compatibility with first loader versions
var limit =
options4me.limit ||