shellscape / webpack-manifest-plugin

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

Define other manifest fields #25

Closed Findiglay closed 7 years ago

Findiglay commented 8 years ago

Is there some way to predefine other manifest fields, e.g. name, short_name, icons, start_url, background_color, display etc. ?

nareshbhatia commented 7 years ago

This is a very valid question for building the manifest file more flexibly. @Findiglay why did you close it? Does a solution exists?

patoncrispy commented 7 years ago

Going to chime in on this one. Would be lovely to be able to set other fields here.

patoncrispy commented 7 years ago

Ah! You can pass objects to the cache parameter. So, you can do cache: {name: 'my-app-name' } and that will work. Not sure if this is the proper use of cache, but it works. Perhaps having this renamed or made a little more obvious would probably help others.

mastilver commented 7 years ago

Can you give me some concrete use-case? would it be something dynamic?

gmac commented 7 years ago

Using cache would be the proper way to do this. I wouldn't be against renaming that param to something more general like seed – which would be a fairly sensible name for both custom values and shared compiler caches. In doing so, the cache name should remain active (though deprecated) through the next major version release.

nathanbirrell commented 7 years ago

Updated PR #57 to reflect this move to seed.

@mastilver I think the most common use case would be custom keys.

Serkan-devel commented 5 years ago

Does anyone have an example where I can define "name" in the manifest plugin?

Marcosdg3 commented 5 years ago

Does anyone have an example where I can define "name" in the manifest plugin?

I'm sure you have already found your answer but if you were looking for an answer like me, options.seed is what you are looking for.

https://github.com/danethurber/webpack-manifest-plugin#optionsseed

For example:

new ManifestPlugin({
            seed: {
                "name": "Your website name",
                "short_name": "Ur site name",
                "start_url": "/asdf",
                "background_color": "#000000",
                "display": "standalone",
                "theme_color": "#000000"
            }
        })