root 3 年 前
コミット
b9a919cbca
3 ファイル変更28 行追加18 行削除
  1. 2 0
      electron-builder.yml
  2. 18 10
      src/main/main.js
  3. 8 8
      webpack.config.renderer.js

+ 2 - 0
electron-builder.yml

@@ -80,6 +80,8 @@ 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

+ 18 - 10
src/main/main.js

@@ -127,16 +127,24 @@ app.on('activate', () => {
 function createMainWindow() {
 	let window = new BrowserWindow({ autoHideMenuBar: true, show: false, webPreferences: { nodeIntegration: true }, width: 1280, height: 920, minWidth: 601, minHeight: 670 });
 
-	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() });

+ 8 - 8
webpack.config.renderer.js

@@ -69,23 +69,23 @@ let config = {
             title: "Update",
             chunks: ['lib.min', 'update']
         }),
-        new CopyPlugin({
-            patterns: [
-                { from: __dirname + "/src/renderer/cocoblockly-x/", to: "cocoblockly-x/" }]
-        }),
-        new CopyPlugin({
-            patterns: [
-                { from: __dirname + "/src/renderer/assets/upload_error.json" }]
-        }),
         new HtmlWebpackPlugin({
             filename: "upload.html",
             template: "./src/renderer/assets/template.ejs",
             chunks: ['lib.min', 'upload']
         }),
+        new CopyPlugin({
+            patterns: [
+                { from: __dirname + "/src/renderer/assets/upload_error.json" }]
+        }),
         new CopyPlugin({
             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/static/common/ccrb.crt" }]