From ee77a29be53b0d1f101b8066d042ce098d692fff Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Fri, 10 Dec 2021 14:18:21 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BF=AE=E6=94=B9=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E6=97=B6=E7=89=88=E6=9C=AC=E5=8F=B7=E7=94=9F=E6=88=90=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/build/utils.ts | 6 ------ web/build/webpack.config.ts | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/web/build/utils.ts b/web/build/utils.ts index 949bed3b..15c90526 100644 --- a/web/build/utils.ts +++ b/web/build/utils.ts @@ -1,11 +1,5 @@ -import childProcess from 'child_process'; - /** * workbox 匹配plugin的缓存 */ export const workboxPluginPattern = /plugins\/com\.msgbyte(.*?)\/((?!index).)*?\.js/; - -export function getCommitHash(): string { - return String(childProcess.execSync('git rev-parse HEAD')); -} diff --git a/web/build/webpack.config.ts b/web/build/webpack.config.ts index 16857d48..2a9da5c7 100644 --- a/web/build/webpack.config.ts +++ b/web/build/webpack.config.ts @@ -13,7 +13,7 @@ import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin'; import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'; import fs from 'fs'; import WorkboxPlugin from 'workbox-webpack-plugin'; -import { getCommitHash, workboxPluginPattern } from './utils'; +import { workboxPluginPattern } from './utils'; import dayjs from 'dayjs'; // eslint-disable-next-line @typescript-eslint/no-var-requires @@ -47,8 +47,8 @@ const plugins: Configuration['plugins'] = [ 'process.env.SERVICE_URL': JSON.stringify(process.env.SERVICE_URL), 'process.env.VERSION': JSON.stringify( `${process.env.VERSION || packageJson.version}-${dayjs().format( - 'YYYYMMDD' - )}-${getCommitHash()}` + 'YYYYMMDDHHmm' + )}` ), }), new HtmlWebpackPlugin({