How to use it at vite and electron?
See original GitHub issueI use the vite program as electron renderer, but I get follow error:
SyntaxError: Cannot use import statement outside a module
I get #95 message, i need use 【require】 replace 【import】。
but in the vite, I cann’t use require. Is there any way to solve it?
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Top Results From Across the Web
How to create an Electron application with Vite
Create the default Vite application · Install the builder · Let's edit the package.json · Let's edit the config of Vite · We...
Read more >Building a Vue 3 Desktop App with Vite and Electron - LearnVue
To do this, we're going to be using Electron – one of the most popular frameworks for building cross-platform desktop apps with JavaScript....
Read more >How to Set Up ELECTRON in Vite and Vue 3 - YouTube
... going to taking a look at how to build a Vue 3 desktop application from your Vite app.To do this, we're going...
Read more >electron-vite - npm
Start using electron-vite in your project by running `npm i electron-vite`. There are no other projects in the npm registry using electron-vite.
Read more >Building an Electron App with VueJS and Vite | Cody Bontecou
Let's combine the power of Electron with VueJS and Vite to create incredible desktop applications ... Clone this repo and use it as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I will look into it and see if it can be solved.
@OsamaAbbas I create a small project by CLI, the source at vite-electron-builder, and the branch name is [alan_bytecode].
You can test like this:
Then, the bytenode can work .js at ‘/packages/main/dist/’ and ‘/packages/preload/dist/’. But the vite code at ‘/packages/renderer/dist/’, I get some error: SyntaxError: Unexpected token ‘export’ or: SyntaxError: Cannot use import statement outside a module or other.