mirror of
https://github.com/jeecgboot/jeecg-boot.git
synced 2025-09-03 19:05:49 +00:00
v3.8.1发布,上传前端代码
This commit is contained in:
@@ -35,6 +35,16 @@ function createConfig(params: CreateConfigParams) {
|
||||
|
||||
console.log(colors.cyan(`✨ [${pkg.name}]`) + ` - configuration file is build successfully:`);
|
||||
console.log(colors.gray(OUTPUT_DIR + '/' + colors.green(configFileName)) + '\n');
|
||||
|
||||
// update-begin--author:sunjianlei---date:20250423---for:【QQYUN-9685】构建 electron 桌面应用
|
||||
// 如果是 Electron 环境,还需要将配置文件写入到 JSON 文件中
|
||||
if (config.VITE_GLOB_RUN_PLATFORM === 'electron') {
|
||||
writeFileSync(getRootPath(`${OUTPUT_DIR}/electron/env.json`), JSON.stringify(config));
|
||||
console.log(colors.cyan(`✨ [${pkg.name}]`) + ` - electron env file is build successfully:`);
|
||||
console.log(colors.gray(OUTPUT_DIR + '/' + colors.green('electron/env.json')) + '\n');
|
||||
}
|
||||
// update-end----author:sunjianlei---date:20250423---for:【QQYUN-9685】构建 electron 桌面应用
|
||||
|
||||
} catch (error) {
|
||||
console.log(colors.red('configuration file configuration file failed to package:\n' + error));
|
||||
}
|
||||
|
@@ -49,6 +49,14 @@ export function wrapperEnv(envConf: Recordable): ViteEnv {
|
||||
* 获取当前环境下生效的配置文件名
|
||||
*/
|
||||
function getConfFiles() {
|
||||
|
||||
// update-begin--author:sunjianlei---date:20250411---for:【QQYUN-9685】构建 electron 桌面应用
|
||||
const {VITE_GLOB_RUN_PLATFORM} = process.env
|
||||
if (VITE_GLOB_RUN_PLATFORM === 'electron') {
|
||||
return ['.env', '.env.prod_electron'];
|
||||
}
|
||||
// update-end----author:sunjianlei---date:20250411---for:【QQYUN-9685】构建 electron 桌面应用
|
||||
|
||||
const script = process.env.npm_lifecycle_script;
|
||||
// update-begin--author:liaozhiyang---date:20240326---for:【QQYUN-8690】修正获取当前环境下的文件名
|
||||
const reg = new RegExp('NODE_ENV=([a-z_\\d]+)');
|
||||
|
34
jeecgboot-vue3/build/vite/plugin/electron.ts
Normal file
34
jeecgboot-vue3/build/vite/plugin/electron.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
// import electron from 'vite-plugin-electron/simple'
|
||||
//
|
||||
// export function configElectronPlugin(_viteEnv: ViteEnv, isBuild: boolean) {
|
||||
// return electron({
|
||||
// main: {
|
||||
// // 主进程入口
|
||||
// entry: 'electron/main.ts',
|
||||
// vite: {
|
||||
// build: {
|
||||
// sourcemap: !isBuild,
|
||||
// outDir: 'dist/electron',
|
||||
// },
|
||||
// },
|
||||
// onstart: ({startup}) => {
|
||||
// // 开发热重载
|
||||
// startup()
|
||||
// },
|
||||
// },
|
||||
// preload: {
|
||||
// input: 'electron/preload/index.ts',
|
||||
// vite: {
|
||||
// build: {
|
||||
// sourcemap: !isBuild,
|
||||
// outDir: 'dist/electron/preload',
|
||||
// },
|
||||
// },
|
||||
// onstart: ({startup}) => {
|
||||
// // 开发热重载
|
||||
// startup()
|
||||
// },
|
||||
// }
|
||||
// })
|
||||
//
|
||||
// }
|
@@ -16,6 +16,8 @@ import { configVisualizerConfig } from './visualizer';
|
||||
import { configThemePlugin } from './theme';
|
||||
import { configSvgIconsPlugin } from './svgSprite';
|
||||
import { configQiankunMicroPlugin } from './qiankunMicro';
|
||||
// // electron plugin
|
||||
// import { configElectronPlugin } from "./electron";
|
||||
// //预编译加载插件(不支持vite3作废)
|
||||
// import OptimizationPersist from 'vite-plugin-optimize-persist';
|
||||
// import PkgConfig from 'vite-plugin-package-config';
|
||||
@@ -68,6 +70,12 @@ export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean, isQiankunM
|
||||
vitePlugins.push(...configQiankunMicroPlugin(viteEnv))
|
||||
}
|
||||
|
||||
// // electron plugin
|
||||
// const isElectron = viteEnv.VITE_GLOB_RUN_PLATFORM === 'electron';
|
||||
// if (isElectron) {
|
||||
// vitePlugins.push(configElectronPlugin(viteEnv, isBuild))
|
||||
// }
|
||||
|
||||
// The following plugins only work in the production environment
|
||||
if (isBuild) {
|
||||
|
||||
|
Reference in New Issue
Block a user