shellscape / webpack-manifest-plugin

webpack plugin for generating asset manifests
MIT License
1.43k stars 185 forks source link

Allow accessing compilation object in generate() callback #253

Closed t-moennich closed 3 years ago

t-moennich commented 3 years ago

This PR contains:

Are tests included?

Breaking Changes?

If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.

List any relevant issue numbers:

Description

This PR adds access to the Compilation object in the generate() callback to allow working with the new ChunkGraph API

codecov-io commented 3 years ago

Codecov Report

Merging #253 (dcd13f5) into master (9333cc1) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #253   +/-   ##
=======================================
  Coverage   98.19%   98.19%           
=======================================
  Files           3        3           
  Lines         111      111           
=======================================
  Hits          109      109           
  Misses          2        2           
Impacted Files Coverage Δ
lib/helpers.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9333cc1...dcd13f5. Read the comment docs.

shellscape commented 3 years ago

Thanks for opening a PR. Looks like a good change to me. As the PR mentions, we don't accept fixes or features without accompanying tests. You'll likely have to update the test for generate, and I'd like to see a test added for that new parameter specifically.

shellscape commented 3 years ago

@t-moennich a quick ping. If there's no action on this PR for another 14 days I'll have to assume it's been abandoned.

shellscape commented 3 years ago

Closing as abandoned

simeyla commented 2 years ago

@shellscape I thought this was exactly what I was looking for but it was never merged. Is there a workaround for this issue.

I've been getting errors like this when using generate to try to access deprecated methods such as file.chunk.getModules()

There was no ChunkGraph assigned to the Chunk for backward-compat (Use the new API)

Is there another way to access ChunkGraph inside Generate or to actually force the legacy ChunkGraph to be assigned to each file passed to generate ?