Ignore:
Timestamp:
11/25/21 22:08:24 (3 years ago)
Author:
Ema <ema_spirova@…>
Branches:
master
Children:
8d391a1
Parents:
59329aa
Message:

primeNG components

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  
    77
    88var _schemaUtils = require("schema-utils");
    9 
    10 var _identifier = require("webpack/lib/util/identifier");
    119
    1210var _pluginOptions = _interopRequireDefault(require("./plugin-options.json"));
     
    5452        identifierIndex,
    5553        content,
     54        layer,
     55        supports,
    5656        media,
    5757        sourceMap,
     
    6565        this._identifierIndex = identifierIndex;
    6666        this.content = content;
     67        this.layer = layer;
     68        this.supports = supports;
    6769        this.media = media;
    6870        this.sourceMap = sourceMap;
     
    108110
    109111      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) {
    111113          this._needBuild = true;
    112114          this.content = module.content;
     115          this.layer = module.layer;
     116          this.supports = module.supports;
    113117          this.media = module.media;
    114118          this.sourceMap = module.sourceMap;
     
    143147        const hash = webpack.util.createHash(hashFunction);
    144148        hash.update(this.content);
     149
     150        if (this.layer) {
     151          hash.update(this.layer);
     152        }
     153
     154        hash.update(this.supports || "");
    145155        hash.update(this.media || "");
    146156        hash.update(this.sourceMap || "");
     
    161171        write(this._identifierIndex);
    162172        write(this.content);
     173        write(this.layer);
     174        write(this.supports);
    163175        write(this.media);
    164176        write(this.sourceMap);
     
    190202        const identifierIndex = read();
    191203        const content = read();
     204        const layer = read();
     205        const supports = read();
    192206        const media = read();
    193207        const sourceMap = read();
     
    199213          identifierIndex,
    200214          content,
     215          layer,
     216          supports,
    201217          media,
    202218          sourceMap,
     
    225241        identifier,
    226242        content,
     243        layer,
     244        supports,
    227245        media,
    228246        sourceMap
     
    232250        this.identifierIndex = identifierIndex;
    233251        this.content = content;
     252        this.layer = layer;
     253        this.supports = supports;
    234254        this.media = media;
    235255        this.sourceMap = sourceMap;
     
    256276        write(this.identifier);
    257277        write(this.content);
     278        write(this.layer);
     279        write(this.supports);
    258280        write(this.media);
    259281        write(this.sourceMap);
     
    284306          identifier: read(),
    285307          content: read(),
     308          layer: read(),
     309          supports: read(),
    286310          media: read(),
    287311          sourceMap: read()
     
    307331      filename: DEFAULT_FILENAME,
    308332      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
    310337    }, options);
    311338    this.runtimeOptions = {
     
    347374
    348375    if (this.options.experimentalUseImportModule) {
    349       if (!compiler.options.experiments) {
    350         throw new Error("experimentalUseImportModule is only support for webpack >= 5.33.2");
    351       }
    352 
    353376      if (typeof compiler.options.experiments.executeModule === "undefined") {
    354377        // eslint-disable-next-line no-param-reassign
     
    469492          chunk.contentHash[_utils.MODULE_TYPE] = hash.digest(hashDigest).substring(0, hashDigestLength);
    470493        }
    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
    472500      const {
    473         Template
    474       } = webpack;
    475       const {
     501        Template,
    476502        RuntimeGlobals,
     503        RuntimeModule,
    477504        runtime
    478505      } = webpack; // eslint-disable-next-line no-shadow
     
    497524        return obj;
    498525      };
    499 
    500       const {
    501         RuntimeModule
    502       } = webpack;
    503526
    504527      class CssLoadingRuntimeModule extends RuntimeModule {
     
    715738        }
    716739
     740        if (module.supports) {
     741          source.add(`@supports (${module.supports}) {\n`);
     742        }
     743
    717744        if (module.media) {
    718745          source.add(`@media ${module.media} {\n`);
    719746        }
    720747
     748        const needLayer = typeof module.layer !== "undefined";
     749
     750        if (needLayer) {
     751          source.add(`@layer${module.layer.length > 0 ? ` ${module.layer}` : ""} {\n`);
     752        }
     753
    721754        const {
    722755          path: filename
    723756        } = 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"), ".");
    725760        content = content.replace(new RegExp(_utils.AUTO_PUBLIC_PATH, "g"), undoPath);
    726761
     
    733768        source.add("\n");
    734769
     770        if (needLayer) {
     771          source.add("}\n");
     772        }
     773
    735774        if (module.media) {
     775          source.add("}\n");
     776        }
     777
     778        if (module.supports) {
    736779          source.add("}\n");
    737780        }
  • trip-planner-front/node_modules/mini-css-extract-plugin/dist/loader.js

    r59329aa re29cc2e  
    8888      const exports = originalExports.__esModule ? originalExports.default : originalExports;
    8989      namedExport = // eslint-disable-next-line no-underscore-dangle
    90       originalExports.__esModule && !("locals" in originalExports.default);
     90      originalExports.__esModule && (!originalExports.default || !("locals" in originalExports.default));
    9191
    9292      if (namedExport) {
     
    109109        dependencies = [[null, exports]];
    110110      } else {
    111         dependencies = exports.map(([id, content, media, sourceMap]) => {
     111        dependencies = exports.map(([id, content, media, sourceMap, supports, layer]) => {
    112112          let identifier = id;
    113113          let context;
     
    129129            content: Buffer.from(content),
    130130            media,
     131            supports,
     132            layer,
    131133            sourceMap: sourceMap ? Buffer.from(JSON.stringify(sourceMap)) : // eslint-disable-next-line no-undefined
    132134            undefined
     
    165167  }
    166168
    167   if (optionsFromPlugin.experimentalUseImportModule) {
     169  if (typeof optionsFromPlugin.experimentalUseImportModule === "undefined" && typeof this.importModule === "function" || optionsFromPlugin.experimentalUseImportModule) {
    168170    if (!this.importModule) {
    169       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."));
     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."));
    170172      return;
    171173    }
    172174
    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}`, {
    174178      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);
    179183        return;
    180184      }
     
    307311
    308312
    309 function _default() {}
     313function _default(content) {
     314  console.log(content);
     315}
  • trip-planner-front/node_modules/mini-css-extract-plugin/dist/plugin-options.json

    r59329aa re29cc2e  
    3939    },
    4040    "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.",
    4242      "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#insert",
    4343      "anyOf": [
     
    5151    },
    5252    "attributes": {
    53       "description": "Adds custom attributes to tag.",
     53      "description": "Adds custom attributes to the `link` tag for non-initial (async) (https://webpack.js.org/concepts/under-the-hood/#chunks) CSS chunks.",
    5454      "link": "https://github.com/webpack-contrib/mini-css-extract-plugin#attributes",
    5555      "type": "object"
     
    6666      "description": "This option allows loading asynchronous chunks with a custom link type",
    6767      "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"
    6873    }
    6974  }
  • trip-planner-front/node_modules/mini-css-extract-plugin/dist/utils.js

    r59329aa re29cc2e  
    99exports.compareModulesByIdentifier = compareModulesByIdentifier;
    1010exports.stringifyRequest = stringifyRequest;
    11 exports.AUTO_PUBLIC_PATH = exports.MODULE_TYPE = void 0;
     11exports.getUndoPath = getUndoPath;
     12exports.SINGLE_DOT_PATH_SEGMENT = exports.ABSOLUTE_PUBLIC_PATH = exports.AUTO_PUBLIC_PATH = exports.MODULE_TYPE = void 0;
    1213
    1314var _module = _interopRequireDefault(require("module"));
     
    7273const MODULE_TYPE = "css/mini-extract";
    7374exports.MODULE_TYPE = MODULE_TYPE;
    74 const AUTO_PUBLIC_PATH = "__MINI_CSS_EXTRACT_PLUGIN_PUBLIC_PATH__";
     75const AUTO_PUBLIC_PATH = "__mini_css_extract_plugin_public_path_auto__";
    7576exports.AUTO_PUBLIC_PATH = AUTO_PUBLIC_PATH;
     77const ABSOLUTE_PUBLIC_PATH = "webpack:///mini-css-extract-plugin/";
     78exports.ABSOLUTE_PUBLIC_PATH = ABSOLUTE_PUBLIC_PATH;
     79const SINGLE_DOT_PATH_SEGMENT = "__mini_css_extract_plugin_single_dot_path_segment__";
     80exports.SINGLE_DOT_PATH_SEGMENT = SINGLE_DOT_PATH_SEGMENT;
    7681
    7782function isAbsolutePath(str) {
     
    115120  }).join("!"));
    116121}
     122
     123function 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.