From dde3407fb0e6e22f97e0ded17541952dbceb7a88 Mon Sep 17 00:00:00 2001
From: hooray <304327508@qq.com>
Date: Tue, 25 Oct 2022 08:26:55 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=20copyright=20=E4=BF=A1?=
=?UTF-8?q?=E6=81=AF=E5=92=8C=E5=B1=95=E7=A4=BA=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
vite/plugins/html.ts | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/vite/plugins/html.ts b/vite/plugins/html.ts
index 54b7102b..c21b6a7c 100644
--- a/vite/plugins/html.ts
+++ b/vite/plugins/html.ts
@@ -1,20 +1,22 @@
import { createHtmlPlugin } from 'vite-plugin-html'
-const copyright_common_style = 'font-size: 14px; margin-bottom: 2px; padding: 6px 8px; color: #fff;'
-const copyright_main_style = `${copyright_common_style} background: #e24329;`
-const copyright_sub_style = `${copyright_common_style} background: #707070;`
-
export default function createHtml(env, isBuild) {
const { VITE_APP_TITLE, VITE_APP_DEBUG_TOOL, VITE_APP_MODE } = env
- let copyrightScript = `
+ let copyrightScript = ''
+ if (isBuild) {
+ const copyright_common_style = 'font-size: 14px; margin-bottom: 2px; padding: 6px 8px; color: #fff;'
+ const copyright_main_style = `${copyright_common_style} background: #e24329;`
+ const copyright_sub_style = `${copyright_common_style} background: #707070;`
+ copyrightScript += `
- `
+ `
+ }
if (VITE_APP_MODE === 'example') {
copyrightScript += `
`
- const html = createHtmlPlugin({
+ return createHtmlPlugin({
inject: {
data: {
title: VITE_APP_TITLE,
@@ -83,5 +85,4 @@ if ((navigator.language || navigator.browserLanguage).toLowerCase() === 'zh-cn')
},
minify: isBuild,
})
- return html
}