Server IP : 162.213.251.212 / Your IP : 18.227.134.162 [ Web Server : LiteSpeed System : Linux business55.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : allssztx ( 535) PHP Version : 8.1.31 Disable Function : NONE Domains : 1 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/allssztx/public_html/easybuyer/node_modules/webpack/lib/schemes/ |
Upload File : |
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; const { URL, fileURLToPath } = require("url"); const { NormalModule } = require(".."); /** @typedef {import("../Compiler")} Compiler */ class FileUriPlugin { /** * Apply the plugin * @param {Compiler} compiler the compiler instance * @returns {void} */ apply(compiler) { compiler.hooks.compilation.tap( "FileUriPlugin", (compilation, { normalModuleFactory }) => { normalModuleFactory.hooks.resolveForScheme .for("file") .tap("FileUriPlugin", resourceData => { const url = new URL(resourceData.resource); const path = fileURLToPath(url); const query = url.search; const fragment = url.hash; resourceData.path = path; resourceData.query = query; resourceData.fragment = fragment; resourceData.resource = path + query + fragment; return true; }); const hooks = NormalModule.getCompilationHooks(compilation); hooks.readResource .for(undefined) .tapAsync("FileUriPlugin", (loaderContext, callback) => { const { resourcePath } = loaderContext; loaderContext.addDependency(resourcePath); loaderContext.fs.readFile(resourcePath, callback); }); } ); } } module.exports = FileUriPlugin;