Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: type: module #471

Merged
merged 43 commits into from
May 16, 2024
Merged

ref: type: module #471

merged 43 commits into from
May 16, 2024

Conversation

RobertGemmaJr
Copy link
Member

@RobertGemmaJr RobertGemmaJr commented May 14, 2024

  • Adds type: module to the package.json
  • Specifies eslint as CJS
  • Refactors forge.config.js and .prettierrc.js to be ES Modules
  • Removes the renderer.js file, the index.html loads index.jsx directly
  • Cleans up the vite config files a fair bit
  • Specifies the vite builds as CJS

Vite Builds

I've been able to dig into how the Electron forge plugin is working with the Vite configurations. Basically the config section of "@electron-forge/plugin-vite" the basic configuration for vite, which vite.__.config.js override. forge.config.js is where we pass in the Electron files to be built and the specific vite configs handle the core of the building process.

The big takeaway is that, even though Vite handles the ESM format, electron-forge builds the app as CJS. All I really had to do was update the file extensions to specify CJS and vite runs the built files correctly. Obviously I would like the files to be built to ESM but that seems to be blocked by the electron-forge plugin itself.

Copy link

github-actions bot commented May 14, 2024

Visit the preview URL for this PR (updated for commit 48a7c04):

https://ccv-honeycomb--pr471-type-module-28cnc5nr.web.app

(expires Thu, 23 May 2024 19:22:49 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 4ace1dcea913a952d2a1af84b94a4421bf36e610

Removes the renderer.js file
@RobertGemmaJr RobertGemmaJr self-assigned this May 14, 2024
@RobertGemmaJr RobertGemmaJr marked this pull request as ready for review May 14, 2024 16:37
@RobertGemmaJr RobertGemmaJr changed the title Type module ref: type: module May 14, 2024
@RobertGemmaJr RobertGemmaJr added the 4.0 Versioning: Issue in regards to version 4.0.0 release label May 14, 2024
Copy link

@broarr broarr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I love modules

@RobertGemmaJr RobertGemmaJr merged commit 0ec443c into feat-forge-vite May 16, 2024
8 checks passed
@RobertGemmaJr RobertGemmaJr deleted the type-module branch May 16, 2024 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.0 Versioning: Issue in regards to version 4.0.0 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants