Closed iancleary closed 1 year ago
Initially followed https://github.com/saltyshiomix/nextron/pull/314, but found all I need to do was to update my .gitignore
and my renderer/next.config.js
file:
See the diff in https://github.com/iancleary/horizon/pull/12/commits/72977ed559624ff524391259ad8b0c784a45f2d8.
You can see running in dev mode nextron
with npm run dev
works:
Production nextron build
also works.
The only thing to note is that the dev and build temporary files share the root app/ folder. If you care to preserve both, that might be an issue for you. I am fine with that as they are both folders that are removed/cleaned in the start of dev mode or the start of a build...so no stale files cross contaminate across dev to prod or from prod to dev.
Prod nextron build
working!
~/Development/horizon on feat/#10-nextjs-app-layout ········································································································································································································································· took 1m 17s
❯ npm run build
> horizon@1.0.0 build
> nextron build
[nextron] Clearing previous builds
[nextron] Building renderer process
- info Creating an optimized production build
- info Compiled successfully
- info Linting and checking validity of types
- info Collecting page data
- info Generating static pages (4/4)
- info Finalizing page optimization
Route (app) Size First Load JS
┌ ○ / 4.81 kB 87.3 kB
└ ○ /next 175 B 82.7 kB
+ First Load JS shared by all 76.8 kB
├ chunks/25b6c4a8-35fb2666dc5d03bb.js 50.5 kB
├ chunks/898-9bc04a48dfaa59ef.js 24.6 kB
├ chunks/main-app-35041217c9e52245.js 199 B
└ chunks/webpack-cff04033fb4b8e99.js 1.59 kB
Route (pages) Size First Load JS
─ ○ /404 189 B 85.8 kB
+ First Load JS shared by all 85.6 kB
├ chunks/main-5baf5c046ee6f018.js 83.8 kB
├ chunks/pages/_app-53496c3be8fb58da.js 191 B
└ chunks/webpack-cff04033fb4b8e99.js 1.59 kB
○ (Static) automatically rendered as static HTML (uses no initial props)
- warn "next export" is no longer needed when "output: export" is configured in next.config.js https://nextjs.org/docs/advanced-features/static-html-export
Export successful. Files written to /Users/iancleary/Development/horizon/app
[nextron] Building main process
[nextron] Packaging - please wait a moment
• electron-builder version=23.6.0 os=22.4.0
• loaded configuration file=/Users/iancleary/Development/horizon/electron-builder.yml
• writing effective config file=dist/builder-effective-config.yaml
• packaging platform=darwin arch=arm64 electron=21.3.3 appOutDir=dist/mac-arm64
• signing file=dist/mac-arm64/Horizon.app identityName=Apple Development: hello@iancleary.me (2HR88G5Z69) identityHash=5FEA714FB388295CF95C4E12E27444E9246FBBE9 provisioningProfile=none
• building target=macOS zip arch=arm64 file=dist/Horizon-1.0.0-arm64-mac.zip
• building target=DMG arch=arm64 file=dist/Horizon-1.0.0-arm64.dmg
• Detected arm64 process, HFS+ is unavailable. Creating dmg with APFS - supports Mac OSX 10.12+
• building block map blockMapFile=dist/Horizon-1.0.0-arm64.dmg.blockmap
• building block map blockMapFile=dist/Horizon-1.0.0-arm64-mac.zip.blockmap
[nextron] See `dist` directory
~/Development/horizon on feat/#10-nextjs-app-layout ············································································································································································································································ took 50s
https://nextjs.org/docs/getting-started/installation