webpack/lib/dependencies/WebAssemblyExportImportedDe...

35 lines
801 B
JavaScript
Raw Normal View History

/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
2018-07-30 23:08:51 +08:00
"use strict";
const DependencyReference = require("./DependencyReference");
const ModuleDependency = require("./ModuleDependency");
class WebAssemblyExportImportedDependency extends ModuleDependency {
constructor(exportName, request, name) {
super(request);
/** @type {string} */
this.exportName = exportName;
/** @type {string} */
this.name = name;
}
2018-07-25 15:33:48 +08:00
/**
* Returns the referenced module and export
* @returns {DependencyReference} reference
*/
getReference() {
if (!this.module) return null;
2018-07-23 03:01:05 +08:00
return new DependencyReference(() => this.module, [this.name], false);
}
get type() {
return "wasm export import";
}
}
module.exports = WebAssemblyExportImportedDependency;