Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Docs #104

Closed
wants to merge 6 commits into from
Closed

Improve Docs #104

wants to merge 6 commits into from

Conversation

a-x-
Copy link
Contributor

@a-x- a-x- commented Nov 8, 2017

@a-x- a-x- requested a review from mastilver November 8, 2017 08:19
@codecov-io
Copy link

codecov-io commented Nov 8, 2017

Codecov Report

Merging #104 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #104   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           2      2           
  Lines          78     78           
=====================================
  Hits           78     78

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 409b0fb...8f7e3f0. Read the comment docs.

Copy link
Contributor

@mastilver mastilver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Great :)

Just a couple thinks

@@ -93,13 +93,31 @@ Type: `function`

Filter out files. [more details](#hooks-options)

**Use-case**: Omit [dll-chunks] ([issue](https://github.com/danethurber/webpack-manifest-plugin/issues/46)):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not specific to dll chunks, also dynamic one (when you use import(...).then(...))

**Use-case**: Add hash information to manifest file for [SRI] ([issue](https://github.com/danethurber/webpack-manifest-plugin/issues/35), [issue](https://github.com/danethurber/webpack-manifest-plugin/issues/55)):
```js
map: ({chunk, file}) => ({ file, hash: chunk.source.integrity }),
generate: (seed, files) => files.reduce((manifest, {name, path}) => manifest), seed),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that is working?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure too 😂
I just rewrited from reduce to generate

after:

map: ({chunk, file}) => {
  return {
    file,
    hash: chunk.source.integrity
  };
}

reduce: (manifest, {chunk, file}) => {
  return manifest;
}

default generate is:

`(seed, files) => files.reduce((manifest, {name, path}) => ({...manifest, [name]: path}), seed)`

@shellscape
Copy link
Owner

Thanks for opening this PR a while back, and I'm sorry that it didn't get attention sooner. We've updated the documentation as part of #222. If you'd like to add examples to the various methods, please open a new issue with your suggestions and we can talk about the concept of a recipes directory.

@shellscape shellscape closed this Oct 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve documentation about webpack-manifest-plugin-after-emit hook.
4 participants