Socket
Socket
Sign inDemoInstall

mini-css-extract-plugin

Package Overview
Dependencies
Maintainers
5
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mini-css-extract-plugin - npm Package Compare versions

Comparing version 2.4.0 to 2.4.1

4

dist/index.js

@@ -10,4 +10,2 @@ "use strict";

var _identifier = require("webpack/lib/util/identifier");
var _pluginOptions = _interopRequireDefault(require("./plugin-options.json"));

@@ -760,3 +758,3 @@

} = compilation.getPathWithInfo(filenameTemplate, pathData);
const undoPath = (0, _identifier.getUndoPath)(filename, compiler.outputPath, false);
const undoPath = (0, _utils.getUndoPath)(filename, compiler.outputPath, false);
content = content.replace(new RegExp(_utils.ABSOLUTE_PUBLIC_PATH, "g"), "");

@@ -763,0 +761,0 @@ content = content.replace(new RegExp(_utils.SINGLE_DOT_PATH_SEGMENT, "g"), ".");

@@ -11,2 +11,3 @@ "use strict";

exports.stringifyRequest = stringifyRequest;
exports.getUndoPath = getUndoPath;
exports.SINGLE_DOT_PATH_SEGMENT = exports.ABSOLUTE_PUBLIC_PATH = exports.AUTO_PUBLIC_PATH = exports.MODULE_TYPE = void 0;

@@ -121,2 +122,35 @@

}).join("!"));
}
function getUndoPath(filename, outputPath, enforceRelative) {
let depth = -1;
let append = ""; // eslint-disable-next-line no-param-reassign
outputPath = outputPath.replace(/[\\/]$/, "");
for (const part of filename.split(/[/\\]+/)) {
if (part === "..") {
if (depth > -1) {
// eslint-disable-next-line no-plusplus
depth--;
} else {
const i = outputPath.lastIndexOf("/");
const j = outputPath.lastIndexOf("\\");
const pos = i < 0 ? j : j < 0 ? i : Math.max(i, j);
if (pos < 0) {
return `${outputPath}/`;
}
append = `${outputPath.slice(pos + 1)}/${append}`; // eslint-disable-next-line no-param-reassign
outputPath = outputPath.slice(0, pos);
}
} else if (part !== ".") {
// eslint-disable-next-line no-plusplus
depth++;
}
}
return depth > 0 ? `${"../".repeat(depth)}${append}` : enforceRelative ? `./${append}` : append;
}
{
"name": "mini-css-extract-plugin",
"version": "2.4.0",
"version": "2.4.1",
"description": "extracts CSS into separate files",

@@ -5,0 +5,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc