什么是create-react-app中的public / manifest.json文件?

reactjs React.js

Tony阿飞

2020-03-19

我知道manifest.json用于chrome扩展,但这是其他内容。它是文件代码:

{
  "short_name": "React App",
  "name": "Create React App Sample",
  "icons": [
    {
      "src": "favicon.ico",
      "sizes": "192x192",
      "type": "image/png"
    }
  ],
  "start_url": "./index.html",
  "display": "standalone",
  "theme_color": "#000000",
  "background_color": "#ffffff"
}

当我更改某些值时,页面会更新,但没有任何变化。

第2236篇《什么是create-react-app中的public / manifest.json文件?》来自Winter(https://github.com/aiyld/aiyld.github.io)的站点

1个回答
达蒙十三 2020.03.19

这是一个Web App清单,它描述您的应用程序,并且如果在主屏幕上添加了快捷方式,则该清单将被移动电话使用。

从MDN(上面链接):

The web app manifest provides information about an application (such as name, author, icon, and description) in a JSON text file. The purpose of the manifest is to install web applications to the homescreen of a device, providing users with quicker access and a richer experience.

问题类别

JavaScript Ckeditor Python Webpack TypeScript Vue.js React.js ExpressJS KoaJS CSS Node.js HTML Django 单元测试 PHP Asp.net jQuery Bootstrap IOS Android