O electron-builder não está empacotando os arquivos python
Esta é a minha estrutura de diretórios onderenderer.js
é incluído porindex.html
. Os scripts pythonvisitor.py
edownload.py
são chamados derenderer.js
através dapython-shell. Depois de agrupar, ele não consegue encontrar os scripts python
|_ index.html
|_ styles.css
|_ main.js
|_ package.json
|_ dist/
|_ node_modules/
|_ renderer.js
|_ visitor.py
|_ download.py
Eu tentei colocar tudofiles: [...]
nopackage.json
sobbuild > files
e depois correunpm run dist
. Eu também tentei copiar arquivos python paradist
pasta explicitamente e depois executounpm run dist
. Nenhum está funcionando.
/Application/test.app/Contents/Resources/app.asar/remderer.js:226 Erro: python: não é possível abrir o arquivo 'visitor.py': [Erro 2] Esse arquivo ou diretório não existe
Este é o meu package.json
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"start": "electron .",
"pack": "build --dir",
"dist": "build"
},
"author": "",
"license": "ISC",
"build": {
"appId": "com.example.app",
"files": [
"dist/",
"node_modules/",
"index.html",
"main.js",
"package.json",
"renderer.js",
"styles.css",
"visitor.py",
"download.py"
],
"dmg": {
"contents": [
{
"x": 110,
"y": 150
},
{
"x": 240,
"y": 150,
"type": "link",
"path": "/Applications"
}
]
},
"linux": {
"target": [
"AppImage",
"deb"
]
},
"win": {
"target": "squirrel",
"icon": "build/icon.ico"
}
},
"dependencies": {
"csv-parse": "^2.5.0",
"electron-css": "^0.6.0",
"npm": "^6.1.0",
"python-shell": "^0.5.0",
},
"devDependencies": {
"electron": "^2.0.3",
"electron-builder": "^20.19.1"
}
}
PS: Este é o construtor de elétrons de que estou falandohttps://github.com/electron-userland/electron-builder