|
|
@@ -4,8 +4,8 @@
|
|
|
*/
|
|
|
import type { PluginOption } from 'vite';
|
|
|
import { createHtmlPlugin } from 'vite-plugin-html';
|
|
|
-import pkg from '../../../package.json';
|
|
|
-import { GLOB_CONFIG_FILE_NAME } from '../../constant';
|
|
|
+// import pkg from '../../../package.json';
|
|
|
+// import { GLOB_CONFIG_FILE_NAME } from '../../constant';
|
|
|
import { simpleGit } from 'simple-git';
|
|
|
const git = simpleGit();
|
|
|
|
|
|
@@ -21,9 +21,9 @@ export function configHtmlPlugin(env: ViteEnv, isBuild: boolean): Promise<Plugin
|
|
|
|
|
|
const path = './';
|
|
|
|
|
|
- const getAppConfigSrc = () => {
|
|
|
- return `${path || '/'}${GLOB_CONFIG_FILE_NAME}?v=${pkg.version}-${new Date().getTime()}`;
|
|
|
- };
|
|
|
+ // const getAppConfigSrc = () => {
|
|
|
+ // return `${path || '/'}${GLOB_CONFIG_FILE_NAME}?v=${pkg.version}-${new Date().getTime()}`;
|
|
|
+ // };
|
|
|
|
|
|
return new Promise((resolve) => {
|
|
|
getLatestHash().then((hash) => {
|
|
|
@@ -35,17 +35,17 @@ export function configHtmlPlugin(env: ViteEnv, isBuild: boolean): Promise<Plugin
|
|
|
title: VITE_GLOB_APP_TITLE,
|
|
|
hash,
|
|
|
},
|
|
|
- // Embed the generated app.config.js file
|
|
|
- tags: isBuild
|
|
|
- ? [
|
|
|
- {
|
|
|
- tag: 'script',
|
|
|
- attrs: {
|
|
|
- src: getAppConfigSrc(),
|
|
|
- },
|
|
|
- },
|
|
|
- ]
|
|
|
- : [],
|
|
|
+ // // Embed the generated app.config.js file
|
|
|
+ // tags: isBuild
|
|
|
+ // ? [
|
|
|
+ // {
|
|
|
+ // tag: 'script',
|
|
|
+ // attrs: {
|
|
|
+ // src: getAppConfigSrc(),
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ // ]
|
|
|
+ // : [],
|
|
|
},
|
|
|
});
|
|
|
resolve(htmlPlugin);
|