Skip to content

Commit f3c64a6

Browse files
committed
add basePath to preload file
1 parent 3f11ef6 commit f3c64a6

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.github/workflows/tag-and-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
run: |
6363
sed -i 's/src="\/_expo/src="_expo/g' dist/index.html
6464
sed -i 's/href="\/_expo/href="_expo/g' dist/index.html
65-
find dist -type f -name '*.js' -exec sed -i 's|/_expo/static/js/web/|./_expo/static/js/web/|g' {} +
65+
find dist -type f -name '*.js' -exec sed -i 's|"/_expo/static/js/web/|window.electron.basePath + "_expo/static/js/web/|g' {} +
6666
6767
- name: Archive production artifacts
6868
uses: actions/upload-artifact@v3

src/preload.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1+
import path from 'path';
2+
13
import { contextBridge, ipcRenderer, IpcRendererEvent } from 'electron';
24

5+
/**
6+
* Expose the basePath to the renderer process.
7+
*/
8+
contextBridge.exposeInMainWorld('electron', {
9+
basePath: `file://${path.join(process.resourcesPath, 'dist')}/`,
10+
});
11+
312
// White-listed channels.
413
const ipc = {
514
render: {

0 commit comments

Comments
 (0)