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

Module require is replicated in bundle file when multiple files import it #2818

Open
iboffa opened this issue Jan 12, 2023 · 1 comment
Open

Comments

@iboffa
Copy link

iboffa commented Jan 12, 2023

Bundling my electron application with the following options:

--bundle --minify --platform=node --packages=external

I noticed a duplicated require('electron') statement in the bundled code:

main.ts contains import { app, BrowserWindow } from 'electron';
app-store.ts, imported by main.ts, contains import { ipcMain } from 'electron';

In the bundle file, I see:

...e=require("electron");var o=require("electron")...

Is there a way to avoid this?

@evanw
Copy link
Owner

evanw commented Jan 12, 2023

This is a known issue. I do plan to address this along with some other significant upcoming linker work, but it's not a severe issue so I'm working on addressing some other stuff first. See also #475.

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

No branches or pull requests

2 participants