react——react腳手架public目錄下檔案講解
阿新 • • 發佈:2021-02-10
目錄截圖
1.favicon.ico
該檔案是瀏覽器的圖示檔案,是一個圖片
2.index.html
- 瀏覽器的主頁面,react腳手架上只有一個html檔案,頁面的轉換由轉換元件完成
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<!-- 指向public目錄下的favicom.ico檔案,給該頁面設定圖示 -->
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<!-- 開啟理想視口,用於做移動端網頁的適配 -->
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- 用於配置瀏覽器頁籤和位址列的顏色(僅支援安卓手機瀏覽器) -->
<meta name="theme-color" content ="#000000" />
<!-- 描述該網站 -->
<meta
name="description"
content="Web site created using create-react-app"
/>
<!-- 用於指定網頁新增到手機主屏幕後的圖示(僅支援蘋果系統) -->
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!-- 應用加殼時的配置檔案 -->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!-- 元件容器 -->
<title>React App</title>
</head>
<body>
<!-- 如果瀏覽器不支援javascript,則會顯示該標籤內容 -->
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
</html>
3.logo192.png
- 一個圖片,在index.html中會用
4.logo512.png
- 一個圖片,在index.html中會用
5.manifest.json
- 配置檔案,在index.html中會用
6.robots.txt
爬蟲規則檔案,當爬蟲爬取檔案時,可以看到(暫時不考慮)