From a75952451bb376a4c5624e62c744930f91f4401b Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@iotlink.com>
Date: 星期二, 03 十一月 2020 18:15:07 +0800
Subject: [PATCH] 添加多页面ico配置

---
 vue.config.js     |    9 +++++++--
 public/index.html |    2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/public/index.html b/public/index.html
index dfcc87a..d7fe62b 100644
--- a/public/index.html
+++ b/public/index.html
@@ -5,7 +5,7 @@
   <meta charset="utf-8" />
   <meta http-equiv="X-UA-Compatible" content="IE=edge" />
   <meta name="viewport" content="width=device-width,initial-scale=1.0" />
-  <link rel="icon" type="image/png" href="<%= htmlWebpackPlugin.options.faviconPath%>" sizes="32x32" />
+  <link rel="icon" type="image/png" href="<%= BASE_URL %>favicon.png" sizes="32x32" />
   <link rel="stylesheet" href="/fonts/alibaba/iconfont.css">
   <title><%= htmlWebpackPlugin.options.title %></title>
 
diff --git a/vue.config.js b/vue.config.js
index ee4c7aa..541395b 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -12,8 +12,7 @@
     entry: path,
     template: 'public/index.html',
     title: chunk == 'desktop/index' ? 'SmartAI' : chunk,
-    chunks: [chunk_vendor, 'chunk-common', chunk],
-    faviconPath: "favicon.png"
+    chunks: [chunk_vendor, 'chunk-common', chunk]
   }
   if (chunk != 'index') {
     pages[chunk].filename = 'view/' + chunk + '.html'
@@ -61,6 +60,12 @@
   },
   productionSourceMap: false,
   filenameHashing: false,
+  pwa: {
+    iconPaths: {
+      favicon32: 'favicon.ico',
+      favicon16: 'favicon.ico'
+    }
+  },
   devServer: {
     proxy: {
       '/track': {

--
Gitblit v1.8.0