From 500cc0eae5bc2a3fe0d158bc143b3cfccf88e0d8 Mon Sep 17 00:00:00 2001 From: gaoshuaixing <530353222@qq.com> Date: Mon, 6 Dec 2021 15:47:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 12 +----------- tools/code_compress.js | 23 ----------------------- 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/main.js b/main.js index 718f309..61a339e 100644 --- a/main.js +++ b/main.js @@ -91,17 +91,7 @@ async function startServer (options) { const developmentModeConfig = electronConfig.get('developmentMode', ENV) const selectMode = developmentModeConfig.default const modeInfo = developmentModeConfig.mode[selectMode] - switch (selectMode) { - case 'vue' : - url = protocol + modeInfo.hostname + ':' + modeInfo.port - break - case 'react' : - url = protocol + modeInfo.hostname + ':' + modeInfo.port - break - case 'ejs' : - url = protocol + modeInfo.hostname + ':' + modeInfo.port - break - } + url = protocol + modeInfo.hostname + ':' + modeInfo.port } eLogger.info('[main] [url]:', url) startRes = await eggLauncher.start(options).then((res) => res, (err) => err) diff --git a/tools/code_compress.js b/tools/code_compress.js index a380d6f..8f1d44a 100644 --- a/tools/code_compress.js +++ b/tools/code_compress.js @@ -40,10 +40,6 @@ class codeCompress { fsPro.copySync(codeDirPath, targetDir); } - - - - } /** @@ -99,24 +95,5 @@ class codeCompress { } -const sourceDir = path.normalize(distDir); -const targetDir = path.normalize('./app/public'); -const sourceIndexFile = path.normalize(sourceDir + '/index.html'); -const targetIndexFile = path.normalize( './app/view/index.ejs'); -if (!fileExist(sourceIndexFile)) { - console.log('[electron] [replace_dist] ERROR source dir is empty!!!'); - return -} -console.log('[electron] [replace_dist] delete target dir:', targetDir); -fs.rmdirSync(targetDir, {recursive: true}); - -console.log('[electron] [replace_dist] copy :', sourceDir); -fsPro.copySync(sourceDir, targetDir); - -// replace ejs -fsPro.copySync(sourceIndexFile, targetIndexFile); -console.log('[electron] [replace_dist] replace index.ejs'); - -console.log('[electron] [replace_dist] end');