- 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/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 }
Note:
See TracChangeset
for help on using the changeset viewer.