Skip to content

use webpack sources instead pseudo object #65

@alexander-akait

Description

@alexander-akait

Ref: webpack/compression-webpack-plugin#236

It is wrong to do this https://github.com/FormidableLabs/webpack-stats-plugin/blob/main/lib/stats-writer-plugin.js#L140 (maybe time to typescript or typescript jsdoc to avoid these problems in future).

It should be for webpack@5:

const source = curCompiler.webpack 
  // webpack@5
  ? curCompiler.webpack.sources.RawSource(statsBuf) 
  // webpack@4
  : {
    source() {
      return statsBuf;
    },
    size() {
      return statsBuf.length;
    }
  }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions