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/
This commit is contained in:
Ilya Kreymer
2024-04-09 15:33:43 -07:00
committed by GitHub
parent 00f01222a7
commit 01a6ebc5b6
3 changed files with 13 additions and 21 deletions
+11 -15
View File
@@ -68,14 +68,14 @@
"/assets", "/assets",
"/dist", "/dist",
"/src", "/src",
"/ruffle", "site/ruffle",
"sw.js", "site/sw.js",
"ui.js", "site/ui.js",
"index.html" "site/index.html"
], ],
"scripts": { "scripts": {
"build": "webpack --mode production && cp dist/ui.js site/ui.js", "build": "webpack --mode production",
"build-dev": "webpack --mode development && cp dist/ui.js site/ui.js", "build-dev": "webpack --mode development",
"build-docs": "yarn run build && cd mkdocs && mkdocs build", "build-docs": "yarn run build && cd mkdocs && mkdocs build",
"start-prod": "cd site && http-server -p 9990 --cors", "start-prod": "cd site && http-server -p 9990 --cors",
"start-dev": "webpack serve --mode development", "start-dev": "webpack serve --mode development",
@@ -106,15 +106,11 @@
"dist/*.js", "dist/*.js",
"dist/prebuilds/${platform}-${arch}/*", "dist/prebuilds/${platform}-${arch}/*",
"dist/build/*", "dist/build/*",
"ui.js", "site/ui.js",
"sw.js", "site/sw.js",
"*.html", "site/index.html",
"ruffle", "site/ruffle",
"webmanifest.json", "site/webmanifest.json"
{
"from": "_site/assets",
"to": "assets"
}
], ],
"dmg": { "dmg": {
"title": "ReplayWeb.page" "title": "ReplayWeb.page"
+1 -1
View File
@@ -5,7 +5,7 @@ import path from "path";
// ============================================================================ // ============================================================================
const replayApp = new ElectronReplayApp({ const replayApp = new ElectronReplayApp({
staticPath: path.join(__dirname, "../"), staticPath: path.join(__dirname, "../site"),
profileName: "replaywebpage", profileName: "replaywebpage",
}); });
+1 -5
View File
@@ -75,10 +75,6 @@ const electronMainConfig = (/*env, argv*/) => {
patterns: [ patterns: [
// { from: "node_modules/classic-level/prebuilds/", to: "prebuilds" }, // { from: "node_modules/classic-level/prebuilds/", to: "prebuilds" },
{ from: "build/extra_prebuilds/", to: "prebuilds" }, { from: "build/extra_prebuilds/", to: "prebuilds" },
{
from: path.resolve(__dirname, "src/assets/favicons"),
to: path.resolve(__dirname, "dist/favicons"),
},
], ],
}), }),
], ],
@@ -140,7 +136,7 @@ const browserConfig = (/*env, argv*/) => {
output: { output: {
path: path.join(__dirname), path: path.join(__dirname),
filename: "dist/[name].js", filename: "site/[name].js",
libraryTarget: "self", libraryTarget: "self",
globalObject: "self", globalObject: "self",
publicPath: "/", publicPath: "/",