Closed Findiglay closed 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?
Going to chime in on this one. Would be lovely to be able to set other fields here.
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.
Can you give me some concrete use-case? would it be something dynamic?
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.
Updated PR #57 to reflect this move to seed
.
@mastilver I think the most common use case would be custom keys.
Does anyone have an example where I can define "name" in the manifest plugin?
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"
}
})
Is there some way to predefine other manifest fields, e.g. name, short_name, icons, start_url, background_color, display etc. ?