question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Duplicate Electron Instance

See original GitHub issue

When vite.config.js is modified, vite spawn a new instance instead of closing the previous one. Screen Shot 2022-07-01 at 11 59 21

export default defineConfig({
    base: './',
    plugins: [
        jsx({}),
        vue({}),
        electron({
            main: {
                entry: 'src/main.ts',
            },
        }),
    ],
    resolve: {
        alias: {
            '@': fileURLToPath(new URL('./src', import.meta.url))
        }
    },
    build: {
        minify: process.env.NODE_ENV === 'production',
    }
})

Note: I used this in my electron project without using Boilerplate with the configuration as in the snippet.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
SupianIDzcommented, Jul 3, 2022

Can you provide a minimize Demo?

Hi @caoxiemeihao

https://github.com/SupianIDz/demo-plugin-vite-electron

git clone https://github.com/SupianIDz/demo-plugin-vite-electron
cd demo-plugin-vite-electron
yarn install
yarn run vite

Then edit and save vite.config.ts

https://user-images.githubusercontent.com/37969970/177026779-3c71f393-2084-4b15-a2ed-52651cab9235.mp4

0reactions
SupianIDzcommented, Jul 7, 2022

@SupianIDz Now, vite-plugin-electron NPM version is available.

Hi, thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to prevent multiple instances in Electron - Stack Overflow
If the instance fails to acquire the lock, it means that it's a duplicate instance which, in this case, we want to close....
Read more >
Prevent duplicate instances of the same window, invoked by ...
Prevent duplicate instances of the same window, invoked by different processes, in an electron app. Author: Ganesh Rathinavel; License: MIT ...
Read more >
'Second-instance' fires instead of 'open-url' in electron on mac
When you open the app from the finder/launch pad, the second-instance event will fire when using the protocol link. To Reproduce. Clone the ......
Read more >
Chapter 5. Working with multiple windows - Electron in Action
Tracking multiple windows using the JavaScript Set data structure; Facilitating communication between the main process and multiple renderer processes; ...
Read more >
App Showcase | Electron
Cloud-based multiplatform clipboard manager that allows you to access, view, and manage your copy history. Website. Productivity. Cozy Desktop.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found