How to specify which files you want to bundle?
See original GitHub issue- Version: 19.52.1
- Target: Mac
I’m building an application using React and SASS. In this application I’m also using ES6/ES7 features. To compile all of my code to distribution ready code I’m using Webpack in combination with Babel.
Now I’m trying to use electron-builder to package my Electron app. This works, but when opening the application I get the following error:
I know this is because Electron can’t handle ES6/ES7 which is fine. That’s why I’m using Babel to compile to ES5. Electron-builder isn’t using these compiles assets tho.
These are the contents of my package.json
(I’ve removed the unnecessary stuff):
{
"main": "src/index.js",
"build": {
"appId": "your.id",
"mac": {
"category": "your.app.category.type"
}
},
"scripts": {
"start": "npm run build:dev",
"start:electron": "./node_modules/.bin/electron src/electron.js",
"build:dev": "BABEL_ENV=dev node_modules/.bin/webpack-dev-server --env=dev",
"build:prod": "BABEL_ENV=prod node_modules/.bin/webpack --env=prod",
"pack": "electron-builder --dir",
"dist": "electron-builder",
"postinstall": "electron-builder install-app-deps"
},
"devDependencies": {
},
"dependencies": {
}
}
So my question is: it is possible to bundle compiled assets? I’ve the index.html
, app.min.js
and app.min.css
files in my dist
folder. How do I specify that I want to use these files for my Electron app?
If you need any more information don’t hesitate to ask. Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top GitHub Comments
This was actually quite easy to solve:
Closing this issue.
This is how my root directory structure: THe *.py files are not loading