static getCssDependency(webpack) {
    /**
     * Prevent creation of multiple CssDependency classes to allow other integrations to get the current CssDependency.
     */
    if (cssDependencyCache.has(webpack)) {
      return /** @type {CssDependencyConstructor} */ (
        cssDependencyCache.get(webpack)
      );
    }

    class CssDependency extends webpack.Dependency {
      /**
       * @param {CssDependencyOptions} loaderDependency
       * @param {string | null} context
       * @param {number} identifierIndex
       */
      constructor(
        { identifier, content, layer, supports, media, sourceMap },
        context,
        identifierIndex
      ) {
        super();

        this.identifier = identifier;
        this.identifierIndex = identifierIndex;
        this.content = content;
        this.layer = layer;
        this.supports = supports;
        this.media = media;
        this.sourceMap = sourceMap;
        this.context = context;
        /** @type {{ [key: string]: Source } | undefined}} */
        // eslint-disable-next-line no-undefined
        this.assets = undefined;
        /** @type {Map<string, AssetInfo> | undefined} */
        // eslint-disable-next-line no-undefined
        this.assetsInfo = undefined;
      }

      /**
       * @returns {ReturnType<Dependency["getResourceIdentifier"]>}
       */
      getResourceIdentifier() {
        return `css-module-${this.identifier}-${this.identifierIndex}`;
      }

      /**
       * @returns {ReturnType<Dependency["getModuleEvaluationSideEffectsState"]>}
       */
      // eslint-disable-next-line class-methods-use-this
      getModuleEvaluationSideEffectsState() {
        return webpack.ModuleGraphConnection.TRANSITIVE_ONLY;
      }

      /**
       * @param {Parameters<Dependency["serialize"]>[0]} context
       */
      serialize(context) {
        const { write } = context;

        write(this.identifier);
        write(this.content);
        write(this.layer);
        write(this.supports);
        write(this.media);
        write(this.sourceMap);
        write(this.context);
        write(this.identifierIndex);
        write(this.assets);
        write(this.assetsInfo);

        super.serialize(context);
      }

      /**
       * @param {Parameters<Dependency["deserialize"]>[0]} context
       */
      deserialize(context) {
        super.deserialize(context);
      }
    }

    cssDependencyCache.set(webpack, CssDependency);

    webpack.util.serialization.register(
      CssDependency,
      path.resolve(__dirname, "CssDependency"),
      // @ts-ignore
      null,
      {
        serialize(instance, context) {
          instance.serialize(context);
        },
        deserialize(context) {
          const { read } = context;
          const dep = new CssDependency(
            {
              identifier: read(),
              content: read(),
              layer: read(),
              supports: read(),
              media: read(),
              sourceMap: read(),
            },
            read(),
            read()
          );

          const assets = read();
          const assetsInfo = read();

          dep.assets = assets;
          dep.assetsInfo = assetsInfo;

          dep.deserialize(context);

          return dep;
        },
      }
    );

    return CssDependency;
  }
@param {Compiler["webpack"]} webpack
@returns {CssDependencyConstructor}