123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- "use strict";
- const { RawSource } = require("webpack-sources");
- const Generator = require("../Generator");
- const { WEBASSEMBLY_TYPES } = require("../ModuleSourceTypesConstants");
- class AsyncWebAssemblyGenerator extends Generator {
-
- constructor(options) {
- super();
- this.options = options;
- }
-
- getTypes(module) {
- return WEBASSEMBLY_TYPES;
- }
-
- getSize(module, type) {
- const originalSource = module.originalSource();
- if (!originalSource) {
- return 0;
- }
- return originalSource.size();
- }
-
- generate(module, generateContext) {
- return (module.originalSource());
- }
-
- generateError(error, module, generateContext) {
- return new RawSource(error.message);
- }
- }
- module.exports = AsyncWebAssemblyGenerator;
|