Skip to content

Commit

Permalink
Electron Fix for 2.0.0 (#304)
Browse files Browse the repository at this point in the history
- build UI.js to site/ directly (build electron to dist/)
- no longer need to copy favicons
- load site assets directly from site/
  • Loading branch information
ikreymer committed Apr 9, 2024
1 parent 00f0122 commit 01a6ebc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 21 deletions.
26 changes: 11 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@
"/assets",
"/dist",
"/src",
"/ruffle",
"sw.js",
"ui.js",
"index.html"
"site/ruffle",
"site/sw.js",
"site/ui.js",
"site/index.html"
],
"scripts": {
"build": "webpack --mode production && cp dist/ui.js site/ui.js",
"build-dev": "webpack --mode development && cp dist/ui.js site/ui.js",
"build": "webpack --mode production",
"build-dev": "webpack --mode development",
"build-docs": "yarn run build && cd mkdocs && mkdocs build",
"start-prod": "cd site && http-server -p 9990 --cors",
"start-dev": "webpack serve --mode development",
Expand Down Expand Up @@ -106,15 +106,11 @@
"dist/*.js",
"dist/prebuilds/${platform}-${arch}/*",
"dist/build/*",
"ui.js",
"sw.js",
"*.html",
"ruffle",
"webmanifest.json",
{
"from": "_site/assets",
"to": "assets"
}
"site/ui.js",
"site/sw.js",
"site/index.html",
"site/ruffle",
"site/webmanifest.json"
],
"dmg": {
"title": "ReplayWeb.page"
Expand Down
2 changes: 1 addition & 1 deletion src/electron-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import path from "path";

// ============================================================================
const replayApp = new ElectronReplayApp({
staticPath: path.join(__dirname, "../"),
staticPath: path.join(__dirname, "../site"),
profileName: "replaywebpage",
});

Expand Down
6 changes: 1 addition & 5 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ const electronMainConfig = (/*env, argv*/) => {
patterns: [
// { from: "node_modules/classic-level/prebuilds/", to: "prebuilds" },
{ from: "build/extra_prebuilds/", to: "prebuilds" },
{
from: path.resolve(__dirname, "src/assets/favicons"),
to: path.resolve(__dirname, "dist/favicons"),
},
],
}),
],
Expand Down Expand Up @@ -140,7 +136,7 @@ const browserConfig = (/*env, argv*/) => {

output: {
path: path.join(__dirname),
filename: "dist/[name].js",
filename: "site/[name].js",
libraryTarget: "self",
globalObject: "self",
publicPath: "/",
Expand Down

0 comments on commit 01a6ebc

Please sign in to comment.