-
Notifications
You must be signed in to change notification settings - Fork 0
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
Bundler updating #1289
Comments
If the |
|
There are two slightly different Electron-Vite sites: |
An interesting anecdote from the migration is that as of 1e6bbb5, we are seeing the following error message: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed. ts(7056) Related to reduxjs/redux-toolkit#3591 and Typescript: "The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.", this error occurs when calling The Lines 13 to 22 in 1e6bbb5
It is not immediately obvious how this relates to
This last point is the cause of those "...inferred type of this node exceeds the maximum length the compiler will serialize..." errors, since Line 14 in 1e6bbb5
|
Since sindresorhus/find-up is pure ESM only (as of v6.0.0), and ESM support in Electron is not going to be released until Electron 28, we must externalize this dependency in order to prevent it being bundled into a CJS module chunk in Vite. The solution for doing so was found alex8088/electron-vite#35: synectic/electron.vite.config.ts Lines 12 to 24 in aef4223
|
A bundler is a tool that puts together all your JavaScript code (and any other formats that can be transpiled into JavaScript code, e.g. TypeScript) and its dependencies and throws a new JavaScript output file with everything merged, ready for the web, commonly known as the bundle file.
As of
v4.4.1
, we utilize Webpack as our bundler. But there are other options available:We focus on Vite as a replacement for Webpack. Per the Vite Getting Started page:
Vite offers a variety of templates for scaffolding various types of Vue, React, Preact, Lit, Svelte, Solid, and Qwik projects (in both JavaScript and TypeScript). And Vite 4.0 uses Rollup, replacing Babel which was the built-in compiler in Vite 3.0 and earlier1.
But for Synectic, a more direct tool to use is called
electron-vite
, which is:1 https://www.infoq.com/news/2022/12/vite-4-faster-swc/
The text was updated successfully, but these errors were encountered: