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

fix: point preloads to native_modules #3280

Closed
wants to merge 3 commits into from

Conversation

PascalPixel
Copy link

@PascalPixel PascalPixel commented Jul 27, 2023

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • The changes are appropriately documented (if applicable).
  • The changes have sufficient test coverage (if applicable).
  • The testsuite passes successfully on my local machine (if applicable).

Summarize your changes:

  • When using the webpack+typescript template if you import any packages that require native_modules the webpack-asset-relocator will inject __dirname into the output files in both development and production
  • Example of package use in preload that causes this issue in the webpack+typescript template; import { auto } from "darkreader";
  • The browser console then reports __dirname is undefined and preload doesn't run
  • Some users have removed webpack-asset-relocator from their webpack configuration to get around this, but without native_modules the BrowserView becomes sluggish
  • This PR applies the patch used for the renderer config to the preloads
  • The tests are updated and pass locally, but I am not sure if this is the effect maintainers want to happen, especially considering there are explicit tests to ensure this isn't applied

@PascalPixel PascalPixel requested a review from a team as a code owner July 27, 2023 23:40
@erickzhao erickzhao changed the title Point preloads to native_modules fix: point preloads to native_modules Jul 27, 2023
@erickzhao
Copy link
Member

I think the logic for this fix was included in #3101, will close this PR for now.

@erickzhao erickzhao closed this Sep 7, 2023
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.

2 participants