Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improve external dependency compatibility: native module detection and DLL exclusion option#3702

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Mulgyeol wants to merge2 commits intoelectron-react-boilerplate:main
base:main
Choose a base branch
Loading
fromMulgyeol:fix/native-dep-dll-compat

Conversation

Mulgyeol
Copy link

Improve External Dependency Compatibility: Native Module Detection & DLL Exclusion Option

Description

While working with Electron React Boilerplate, I noticed that some external packages—especially those with native modules or special export/dynamic import requirements—were causing unexpected build failures.
This PR updates the native module detection logic to be more accurate and adds a simple way for users to exclude problematic packages from the DLL bundle. I believe these changes will make it much easier to integrate a wider variety of dependencies without running into confusing errors.

Changes Made

  • .erb/scripts/check-native-dep.js
    • Updated the detection logic so that only packages with both abinding.gyp file and a direct entry inpackage.json dependencies are flagged as native.
    • Cleaned up the code by removing unnecessarynpm ls parsing and the try-catch block.
  • .erb/configs/webpack.config.renderer.dev.dll.ts
    • Introduced adllExclude array, allowing users to easily specify packages to exclude from the DLL bundle.
    • By default, this array is empty—users can add package names as needed for their setup.

Why

  • I ran into issues where some packages were incorrectly flagged as native modules, which blocked development and caused unnecessary build failures.
  • Additionally, certain packages would break the DLL build due to export or dynamic import issues, and there was no straightforward way to exclude them.
  • With these changes, false positives are avoided, and users have more control over which packages are included in the DLL bundle.

Testing

  • I tested with several packages that previously caused issues and confirmed they are no longer falsely detected as native.
  • I also checked that adding package names todllExclude successfully excludes them from the DLL bundle.
  • The project continues to build and run as expected after these updates.

Only treat packages as native dependencies if they have a binding.gyp file and are listed in package.json dependencies.Remove unnecessary npm ls parsing and try-catch block.Prevents false positives that could block development.
Introduce a dllExclude array in webpack.config.renderer.dev.dll.ts to allow users to easily exclude problematic packages from the DLL bundle.By default, the array is empty. Users can add package names as needed for their environment.Improves flexibility and compatibility with external dependencies.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@Mulgyeol

[8]ページ先頭

©2009-2025 Movatter.jp