Skip to content

Commit 01a6ebc

Browse files
authored
Electron Fix for 2.0.0 (#304)
- build UI.js to site/ directly (build electron to dist/) - no longer need to copy favicons - load site assets directly from site/
1 parent 00f0122 commit 01a6ebc

File tree

3 files changed

+13
-21
lines changed

3 files changed

+13
-21
lines changed

package.json

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@
6868
"/assets",
6969
"/dist",
7070
"/src",
71-
"/ruffle",
72-
"sw.js",
73-
"ui.js",
74-
"index.html"
71+
"site/ruffle",
72+
"site/sw.js",
73+
"site/ui.js",
74+
"site/index.html"
7575
],
7676
"scripts": {
77-
"build": "webpack --mode production && cp dist/ui.js site/ui.js",
78-
"build-dev": "webpack --mode development && cp dist/ui.js site/ui.js",
77+
"build": "webpack --mode production",
78+
"build-dev": "webpack --mode development",
7979
"build-docs": "yarn run build && cd mkdocs && mkdocs build",
8080
"start-prod": "cd site && http-server -p 9990 --cors",
8181
"start-dev": "webpack serve --mode development",
@@ -106,15 +106,11 @@
106106
"dist/*.js",
107107
"dist/prebuilds/${platform}-${arch}/*",
108108
"dist/build/*",
109-
"ui.js",
110-
"sw.js",
111-
"*.html",
112-
"ruffle",
113-
"webmanifest.json",
114-
{
115-
"from": "_site/assets",
116-
"to": "assets"
117-
}
109+
"site/ui.js",
110+
"site/sw.js",
111+
"site/index.html",
112+
"site/ruffle",
113+
"site/webmanifest.json"
118114
],
119115
"dmg": {
120116
"title": "ReplayWeb.page"

src/electron-main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import path from "path";
55

66
// ============================================================================
77
const replayApp = new ElectronReplayApp({
8-
staticPath: path.join(__dirname, "../"),
8+
staticPath: path.join(__dirname, "../site"),
99
profileName: "replaywebpage",
1010
});
1111

webpack.config.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ const electronMainConfig = (/*env, argv*/) => {
7575
patterns: [
7676
// { from: "node_modules/classic-level/prebuilds/", to: "prebuilds" },
7777
{ from: "build/extra_prebuilds/", to: "prebuilds" },
78-
{
79-
from: path.resolve(__dirname, "src/assets/favicons"),
80-
to: path.resolve(__dirname, "dist/favicons"),
81-
},
8278
],
8379
}),
8480
],
@@ -140,7 +136,7 @@ const browserConfig = (/*env, argv*/) => {
140136

141137
output: {
142138
path: path.join(__dirname),
143-
filename: "dist/[name].js",
139+
filename: "site/[name].js",
144140
libraryTarget: "self",
145141
globalObject: "self",
146142
publicPath: "/",

0 commit comments

Comments
 (0)