Skip to content

Commit

Permalink
fix: 打包preload
Browse files Browse the repository at this point in the history
  • Loading branch information
愁余 committed Jan 19, 2024
1 parent 9121c19 commit 64486d0
Show file tree
Hide file tree
Showing 23 changed files with 675 additions and 137 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@ release
# lockfile
package-lock.json
pnpm-lock.yaml
yarn.lock
yarn.lock

recipes/all.json
recipes/archives
23 changes: 0 additions & 23 deletions .vscode/.debug.script.mjs

This file was deleted.

6 changes: 0 additions & 6 deletions .vscode/extensions.json

This file was deleted.

53 changes: 0 additions & 53 deletions .vscode/launch.json

This file was deleted.

13 changes: 0 additions & 13 deletions .vscode/settings.json

This file was deleted.

31 changes: 0 additions & 31 deletions .vscode/tasks.json

This file was deleted.

15 changes: 14 additions & 1 deletion electron-builder.json5
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,20 @@
},
"files": [
"dist-electron",
"dist"
"dist",
"preload/recipe.js"
],
"extraResources": [
{
"from": "./recipes/archives",
"to": "app.asar.unpacked/recipes",
"filter": ["**/*"]
},
{
"from": "./recipes/all.json",
"to": "app.asar.unpacked/recipes/all.json",
"filter": ["**/*"]
}
],
"mac": {
"artifactName": "${productName}_${version}.${ext}",
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@
"electron-builder": "^24.6.3",
"esbuild": "^0.19.11",
"eslint": "^8.41.0",
"image-size": "^1.1.1",
"sass": "^1.62.1",
"simple-git": "^3.22.0",
"targz": "^1.0.1",
"typescript": "^5.0.4",
"unocss": "^0.58.2",
"unplugin-auto-import": "^0.17.3",
Expand Down
1 change: 1 addition & 0 deletions preload/recipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const noop = () => { }
// window.chrome.runtime.sendMessage = noop
const badgeHandler = new BadgeHandler();

console.log('qqqqq ddddd ccccc vvvvv ssss')
contextBridge.exposeInMainWorld('API', {
open: window.open,
setBadge: (direct, indirect) => badgeHandler.setBadge(direct, indirect),
Expand Down
3 changes: 0 additions & 3 deletions recipes/discord/webview.js

This file was deleted.

3 changes: 3 additions & 0 deletions recipes/featured.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"discord"
]
Loading

0 comments on commit 64486d0

Please sign in to comment.