gaoshuaixing hace 4 años
padre
commit
500cc0eae5
Se han modificado 2 ficheros con 1 adiciones y 34 borrados
  1. 1 11
      main.js
  2. 0 23
      tools/code_compress.js

+ 1 - 11
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)

+ 0 - 23
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');