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

build: use vite to bundle deps at main/preload package under ssr mode. #904

Closed
wants to merge 16 commits into from

Conversation

Tanimodori
Copy link
Contributor

See previous try #903 for more details.

@Tanimodori
Copy link
Contributor Author

The dev/prod build was successful on my Windows 10 env. The tests failed because of vitest-dev/vitest#2806 .

@cawa-93
Copy link
Owner

cawa-93 commented Feb 13, 2023

electron-builtins no more needed?

@Tanimodori
Copy link
Contributor Author

Tanimodori commented Feb 13, 2023

No. electron-builtins just wraps electron sub-modules. This package is essentially:

module.exports = [
	// API root
	'electron',

	// common modules
	'clipboard',
	'crash-reporter',
	'deprecations',
	'nativeImage',
	'shell',

        // ...
];

All modules besides electron are sub-modules of electron, which are usually wrote as:

import { clipboard } from 'electron'

But never

import * as clipboard from 'clipboard'

So we just need to externalize electron.

@Tanimodori
Copy link
Contributor Author

Tanimodori commented Feb 14, 2023

Note: If you turned off nodeIntergration for preload package (for example you need to sandbox your preload), you need to disable preserveModules as the require here in preload is polyfilled by electron which cannot resolve multiple files as stated in electron/electron#35587 (comment)

@cawa-93
Copy link
Owner

cawa-93 commented Mar 3, 2023

Hello. I apologize for the delay. Due to... known reasons... I have very little free time. I plan to merge this. But I'd like to wait until the vitest-dev/vitest#2806 issue is resolved so as not to confuse users. Also, I feel that there needs to be some kind of additional documentation in the readme to explain how dependencies work and how they are bundled and delivered to the end user.

@Tanimodori
Copy link
Contributor Author

rollup/rollup#4905 is fixed.

@cawa-93
Copy link
Owner

cawa-93 commented May 23, 2024

Hello. Thank you again for the fantastic job you did. I still think this is a good idea and will definitely keep an eye on it.

Unfortunately, due to the war in my country, I have less and less energy to maintain this project. Recently, major changes have taken place and I have moved this template entirely to the ESM.

In this regard, I consider the implementation in this PR to be outdated and conflicted. I will close it now and try to return to it at some point.

@cawa-93 cawa-93 closed this May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants