- Timestamp:
- 11/25/21 22:08:24 (3 years ago)
- Branches:
- master
- Children:
- 8d391a1
- Parents:
- 59329aa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trip-planner-front/node_modules/mini-css-extract-plugin/dist/utils.js
r59329aa re29cc2e 9 9 exports.compareModulesByIdentifier = compareModulesByIdentifier; 10 10 exports.stringifyRequest = stringifyRequest; 11 exports.AUTO_PUBLIC_PATH = exports.MODULE_TYPE = void 0; 11 exports.getUndoPath = getUndoPath; 12 exports.SINGLE_DOT_PATH_SEGMENT = exports.ABSOLUTE_PUBLIC_PATH = exports.AUTO_PUBLIC_PATH = exports.MODULE_TYPE = void 0; 12 13 13 14 var _module = _interopRequireDefault(require("module")); … … 72 73 const MODULE_TYPE = "css/mini-extract"; 73 74 exports.MODULE_TYPE = MODULE_TYPE; 74 const AUTO_PUBLIC_PATH = "__ MINI_CSS_EXTRACT_PLUGIN_PUBLIC_PATH__";75 const AUTO_PUBLIC_PATH = "__mini_css_extract_plugin_public_path_auto__"; 75 76 exports.AUTO_PUBLIC_PATH = AUTO_PUBLIC_PATH; 77 const ABSOLUTE_PUBLIC_PATH = "webpack:///mini-css-extract-plugin/"; 78 exports.ABSOLUTE_PUBLIC_PATH = ABSOLUTE_PUBLIC_PATH; 79 const SINGLE_DOT_PATH_SEGMENT = "__mini_css_extract_plugin_single_dot_path_segment__"; 80 exports.SINGLE_DOT_PATH_SEGMENT = SINGLE_DOT_PATH_SEGMENT; 76 81 77 82 function isAbsolutePath(str) { … … 115 120 }).join("!")); 116 121 } 122 123 function getUndoPath(filename, outputPath, enforceRelative) { 124 let depth = -1; 125 let append = ""; // eslint-disable-next-line no-param-reassign 126 127 outputPath = outputPath.replace(/[\\/]$/, ""); 128 129 for (const part of filename.split(/[/\\]+/)) { 130 if (part === "..") { 131 if (depth > -1) { 132 // eslint-disable-next-line no-plusplus 133 depth--; 134 } else { 135 const i = outputPath.lastIndexOf("/"); 136 const j = outputPath.lastIndexOf("\\"); 137 const pos = i < 0 ? j : j < 0 ? i : Math.max(i, j); 138 139 if (pos < 0) { 140 return `${outputPath}/`; 141 } 142 143 append = `${outputPath.slice(pos + 1)}/${append}`; // eslint-disable-next-line no-param-reassign 144 145 outputPath = outputPath.slice(0, pos); 146 } 147 } else if (part !== ".") { 148 // eslint-disable-next-line no-plusplus 149 depth++; 150 } 151 } 152 153 return depth > 0 ? `${"../".repeat(depth)}${append}` : enforceRelative ? `./${append}` : append; 154 }
Note:
See TracChangeset
for help on using the changeset viewer.