shellscape / webpack-manifest-plugin

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

options.generate does not exist #126

Closed GuillaumeCisco closed 6 years ago

GuillaumeCisco commented 6 years ago

Hey there looks like the doc is a bit old regarding the code.

This part:

options.generate
Type: function
Default: (seed, files) => files.reduce((manifest, {name, path}) => ({...manifest, [name]: path}), seed)

All entries in files correspond to the object structure described in the Hooks Options section.

Create the manifest. It can return anything as long as it's serialisable by JSON.stringify. more details

No longer exist but the options.reduce function with the options.seed complementary exists.

We should write:

options.reduce
Type: function
Default: (manifest, {name, path}) => ({...manifest, [name]: path})

Create the manifest. It can return anything as long as it's serialisable by JSON.stringify. more details

with

options.seed
Type: object
Default: {}

Init the initial object used by options.reduce. Override it for adding previous data to your manifest.

Hope it helps ;)

mastilver commented 6 years ago

Hi

reduce was removed a while ago, use generate