diego3g / electron-typescript-react

:electron: An Electron boilerplate including TypeScript, React, Jest and ESLint.
1.45k stars 295 forks source link

Add build and packaging script #10

Closed wilgnne closed 4 years ago

wilgnne commented 4 years ago

Addition of production build scripts

These scripts are the basis for packaging the project in an executable

wilgnne commented 4 years ago

To build the executable, an index.js script is needed to be the entry point for electron, otherwise a package.json must be present in the dist folder to indicate the entry point. Which approach would be better, renaming electron/main.ts to electron/index.ts or generating a package.json at compile time?

diego3g commented 4 years ago

I think that we should use the same folder from development, dist, so we don't need to change package.json. What you think about it?

wilgnne commented 4 years ago

I agree with the use of a dist, it will be necessary to include the files that are sent to the bundle in the package.json

"build": {
  "appId": "your.id",
  "mac": {
    "category": "public.app-category.video"
  },
  "files": [
    "package.json"
    "dist/*",
  ]
}
diego3g commented 4 years ago

@Wilgnne can you add that on this PR?

wilgnne commented 4 years ago

ok, i will rename the RP to include the packaging script