- Timestamp:
- 11/25/21 22:08:24 (3 years ago)
- Branches:
- master
- Children:
- 8d391a1
- Parents:
- 59329aa
- Location:
- trip-planner-front/node_modules/mini-css-extract-plugin/dist
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trip-planner-front/node_modules/mini-css-extract-plugin/dist/index.js
r59329aa re29cc2e 7 7 8 8 var _schemaUtils = require("schema-utils"); 9 10 var _identifier = require("webpack/lib/util/identifier");11 9 12 10 var _pluginOptions = _interopRequireDefault(require("./plugin-options.json")); … … 54 52 identifierIndex, 55 53 content, 54 layer, 55 supports, 56 56 media, 57 57 sourceMap, … … 65 65 this._identifierIndex = identifierIndex; 66 66 this.content = content; 67 this.layer = layer; 68 this.supports = supports; 67 69 this.media = media; 68 70 this.sourceMap = sourceMap; … … 108 110 109 111 updateCacheModule(module) { 110 if (this.content !== module.content || this. media !== module.media || this.sourceMap !== module.sourceMap || this.assets !== module.assets || this.assetsInfo !== module.assetsInfo) {112 if (this.content !== module.content || this.layer !== module.layer || this.supports !== module.supports || this.media !== module.media || this.sourceMap !== module.sourceMap || this.assets !== module.assets || this.assetsInfo !== module.assetsInfo) { 111 113 this._needBuild = true; 112 114 this.content = module.content; 115 this.layer = module.layer; 116 this.supports = module.supports; 113 117 this.media = module.media; 114 118 this.sourceMap = module.sourceMap; … … 143 147 const hash = webpack.util.createHash(hashFunction); 144 148 hash.update(this.content); 149 150 if (this.layer) { 151 hash.update(this.layer); 152 } 153 154 hash.update(this.supports || ""); 145 155 hash.update(this.media || ""); 146 156 hash.update(this.sourceMap || ""); … … 161 171 write(this._identifierIndex); 162 172 write(this.content); 173 write(this.layer); 174 write(this.supports); 163 175 write(this.media); 164 176 write(this.sourceMap); … … 190 202 const identifierIndex = read(); 191 203 const content = read(); 204 const layer = read(); 205 const supports = read(); 192 206 const media = read(); 193 207 const sourceMap = read(); … … 199 213 identifierIndex, 200 214 content, 215 layer, 216 supports, 201 217 media, 202 218 sourceMap, … … 225 241 identifier, 226 242 content, 243 layer, 244 supports, 227 245 media, 228 246 sourceMap … … 232 250 this.identifierIndex = identifierIndex; 233 251 this.content = content; 252 this.layer = layer; 253 this.supports = supports; 234 254 this.media = media; 235 255 this.sourceMap = sourceMap; … … 256 276 write(this.identifier); 257 277 write(this.content); 278 write(this.layer); 279 write(this.supports); 258 280 write(this.media); 259 281 write(this.sourceMap); … … 284 306 identifier: read(), 285 307 content: read(), 308 layer: read(), 309 supports: read(), 286 310 media: read(), 287 311 sourceMap: read() … … 307 331 filename: DEFAULT_FILENAME, 308 332 ignoreOrder: false, 309 experimentalUseImportModule: false 333 // TODO remove in the next major release 334 // eslint-disable-next-line no-undefined 335 experimentalUseImportModule: undefined, 336 runtime: true 310 337 }, options); 311 338 this.runtimeOptions = { … … 347 374 348 375 if (this.options.experimentalUseImportModule) { 349 if (!compiler.options.experiments) {350 throw new Error("experimentalUseImportModule is only support for webpack >= 5.33.2");351 }352 353 376 if (typeof compiler.options.experiments.executeModule === "undefined") { 354 377 // eslint-disable-next-line no-param-reassign … … 469 492 chunk.contentHash[_utils.MODULE_TYPE] = hash.digest(hashDigest).substring(0, hashDigestLength); 470 493 } 471 }); 494 }); // All the code below is dedicated to the runtime and can be skipped when the `runtime` option is `false` 495 496 if (!this.options.runtime) { 497 return; 498 } 499 472 500 const { 473 Template 474 } = webpack; 475 const { 501 Template, 476 502 RuntimeGlobals, 503 RuntimeModule, 477 504 runtime 478 505 } = webpack; // eslint-disable-next-line no-shadow … … 497 524 return obj; 498 525 }; 499 500 const {501 RuntimeModule502 } = webpack;503 526 504 527 class CssLoadingRuntimeModule extends RuntimeModule { … … 715 738 } 716 739 740 if (module.supports) { 741 source.add(`@supports (${module.supports}) {\n`); 742 } 743 717 744 if (module.media) { 718 745 source.add(`@media ${module.media} {\n`); 719 746 } 720 747 748 const needLayer = typeof module.layer !== "undefined"; 749 750 if (needLayer) { 751 source.add(`@layer${module.layer.length > 0 ? ` ${module.layer}` : ""} {\n`); 752 } 753 721 754 const { 722 755 path: filename 723 756 } = compilation.getPathWithInfo(filenameTemplate, pathData); 724 const undoPath = (0, _identifier.getUndoPath)(filename, compiler.outputPath, false); 757 const undoPath = (0, _utils.getUndoPath)(filename, compiler.outputPath, false); 758 content = content.replace(new RegExp(_utils.ABSOLUTE_PUBLIC_PATH, "g"), ""); 759 content = content.replace(new RegExp(_utils.SINGLE_DOT_PATH_SEGMENT, "g"), "."); 725 760 content = content.replace(new RegExp(_utils.AUTO_PUBLIC_PATH, "g"), undoPath); 726 761 … … 733 768 source.add("\n"); 734 769 770 if (needLayer) { 771 source.add("}\n"); 772 } 773 735 774 if (module.media) { 775 source.add("}\n"); 776 } 777 778 if (module.supports) { 736 779 source.add("}\n"); 737 780 } -
trip-planner-front/node_modules/mini-css-extract-plugin/dist/loader.js
r59329aa re29cc2e 88 88 const exports = originalExports.__esModule ? originalExports.default : originalExports; 89 89 namedExport = // eslint-disable-next-line no-underscore-dangle 90 originalExports.__esModule && !("locals" in originalExports.default);90 originalExports.__esModule && (!originalExports.default || !("locals" in originalExports.default)); 91 91 92 92 if (namedExport) { … … 109 109 dependencies = [[null, exports]]; 110 110 } else { 111 dependencies = exports.map(([id, content, media, sourceMap ]) => {111 dependencies = exports.map(([id, content, media, sourceMap, supports, layer]) => { 112 112 let identifier = id; 113 113 let context; … … 129 129 content: Buffer.from(content), 130 130 media, 131 supports, 132 layer, 131 133 sourceMap: sourceMap ? Buffer.from(JSON.stringify(sourceMap)) : // eslint-disable-next-line no-undefined 132 134 undefined … … 165 167 } 166 168 167 if ( optionsFromPlugin.experimentalUseImportModule) {169 if (typeof optionsFromPlugin.experimentalUseImportModule === "undefined" && typeof this.importModule === "function" || optionsFromPlugin.experimentalUseImportModule) { 168 170 if (!this.importModule) { 169 callback(new Error("You are using experimentalUseImportModulebut 'this.importModule' is not available in loader context. You need to have at least webpack 5.33.2."));171 callback(new Error("You are using 'experimentalUseImportModule' but 'this.importModule' is not available in loader context. You need to have at least webpack 5.33.2.")); 170 172 return; 171 173 } 172 174 173 this.importModule(`${this.resourcePath}.webpack[javascript/auto]!=!${request}`, { 175 const isAbsolutePublicPath = /^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(publicPath); 176 const publicPathForExtract = isAbsolutePublicPath ? publicPath : `${_utils.ABSOLUTE_PUBLIC_PATH}${publicPath.replace(/\./g, _utils.SINGLE_DOT_PATH_SEGMENT)}`; 177 this.importModule(`${this.resourcePath}.webpack[javascript/auto]!=!!!${request}`, { 174 178 layer: options.layer, 175 publicPath 176 }, (err , exports) => {177 if (err ) {178 callback(err );179 publicPath: publicPathForExtract 180 }, (error, exports) => { 181 if (error) { 182 callback(error); 179 183 return; 180 184 } … … 307 311 308 312 309 function _default() {} 313 function _default(content) { 314 console.log(content); 315 } -
trip-planner-front/node_modules/mini-css-extract-plugin/dist/plugin-options.json
r59329aa re29cc2e 39 39 }, 40 40 "insert": { 41 "description": "Inserts `<link>` at the given position.",41 "description": "Inserts the `link` tag at the given position for non-initial (async) (https://webpack.js.org/concepts/under-the-hood/#chunks) CSS chunks.", 42 42 "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#insert", 43 43 "anyOf": [ … … 51 51 }, 52 52 "attributes": { 53 "description": "Adds custom attributes to t ag.",53 "description": "Adds custom attributes to the `link` tag for non-initial (async) (https://webpack.js.org/concepts/under-the-hood/#chunks) CSS chunks.", 54 54 "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#attributes", 55 55 "type": "object" … … 66 66 "description": "This option allows loading asynchronous chunks with a custom link type", 67 67 "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#linktype" 68 }, 69 "runtime": { 70 "type": "boolean", 71 "description": "Enabled/Disables runtime generation. CSS will be still extracted and can be used for a custom loading methods.", 72 "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#noRuntime" 68 73 } 69 74 } -
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.