root 3 年之前
父節點
當前提交
d84693b0b1
共有 3 個文件被更改,包括 21 次插入23 次删除
  1. 0 2
      electron-builder.yml
  2. 17 17
      src/main/main.js
  3. 4 4
      webpack.config.renderer.js

+ 0 - 2
electron-builder.yml

@@ -80,8 +80,6 @@ win:
       to: python
     - from: src/static/win/tools
       to: tools
-    - from: src/renderer/cocoblockly-x
-      to: cocoblockly-x
   extraResources:
     - from: src/static/common/cocorobo.ico
       to: CocoRobo_Tray.ico

+ 17 - 17
src/main/main.js

@@ -128,23 +128,23 @@ function createMainWindow() {
 	let window = new BrowserWindow({ autoHideMenuBar: true, show: false, webPreferences: { nodeIntegration: true }, width: 1280, height: 920, minWidth: 601, minHeight: 670 });
 
 
-	window.loadURL(formatUrl({
-		pathname: path.join(__dirname, '..', '..', 'cocoblockly-x/index.html'),
-		protocol: 'file',
-		slashes: true,
-		search: "lang=zh-hans",
-	}));
-
-	// if (isDevelopment) {
-	// 	window.loadURL(`http://localhost:${process.env.ELECTRON_WEBPACK_WDS_PORT}`);
-	// } else {
-	// 	window.loadURL(formatUrl({
-	// 		pathname: path.join(__dirname, 'cocoblockly-x/index.html'),
-	// 		protocol: 'file',
-	// 		slashes: true,
-	// 		search: "lang=zh-hans",
-	// 	}));
-	// }
+	// window.loadURL(formatUrl({
+	// 	pathname: path.join(__dirname, '..', '..', 'cocoblockly-x/index.html'),
+	// 	protocol: 'file',
+	// 	slashes: true,
+	// 	search: "lang=zh-hans",
+	// }));
+
+	if (isDevelopment) {
+		window.loadURL(`http://localhost:${process.env.ELECTRON_WEBPACK_WDS_PORT}`);
+	} else {
+		window.loadURL(formatUrl({
+			pathname: path.join(__dirname, 'cocoblockly-x/index.html'),
+			protocol: 'file',
+			slashes: true,
+			search: "lang=zh-hans",
+		}));
+	}
 	window.once('ready-to-show', () => window.show());
 
 	window.on('closed', () => { app.quit() });

+ 4 - 4
webpack.config.renderer.js

@@ -82,10 +82,10 @@ let config = {
             patterns: [
                 { from: __dirname + "/src/static/common/ccrb.key" }]
         }),
-        // new CopyPlugin({
-        //     patterns: [
-        //         { from: __dirname + "/src/renderer/cocoblockly-x/", to: "cocoblockly-x/" }]
-        // }),
+        new CopyPlugin({
+            patterns: [
+                { from: __dirname + "/src/renderer/cocoblockly-x/", to: "cocoblockly-x/" }]
+        }),
         new CopyPlugin({
             patterns: [
                 { from: __dirname + "/src/static/common/ccrb.crt" }]