Server IP : 103.11.96.170 / Your IP : 18.116.28.60 Web Server : Microsoft-IIS/10.0 System : Windows NT WIN-F6SLGVICLOP 10.0 build 17763 (Windows Server 2016) AMD64 User : elibrary.unsap.ac.id ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF Directory (0777) : D:/localhost/elibrary/js/quaggaJS/plugins/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
var ConcatSource = require("webpack-sources").ConcatSource; var OriginalSource = require("webpack-sources").OriginalSource; function MyUmdPlugin(options) { this.name = options.library; } module.exports = MyUmdPlugin; MyUmdPlugin.prototype.apply = function(compiler) { compiler.plugin("this-compilation", function(compilation) { var mainTemplate = compilation.mainTemplate; compilation.templatesPlugin("render-with-entry", function(source, chunk, hash) { return new ConcatSource(new OriginalSource( "(function webpackUniversalModuleDefinition(root, factory) {\n" + " if(typeof exports === 'object' && typeof module === 'object')\n" + " module.exports = factory(factory.toString()).default;\n" + " else if(typeof exports === 'object')\n" + " exports[\"" + this.name + "\"] = factory(factory.toString()).default;\n" + " else\n" + " root[\"" + this.name + "\"] = factory(factory.toString()).default;\n" + "})(this, function(__factorySource__) {\nreturn ", "webpack/myModuleDefinition"), source, "\n});\n"); }.bind(this)); mainTemplate.plugin("global-hash-paths", function(paths) { if(this.name) paths = paths.concat(this.name); return paths; }.bind(this)); mainTemplate.plugin("hash", function(hash) { hash.update("umd"); hash.update(this.name + ""); }.bind(this)); }.bind(this)); };