forge icon indicating copy to clipboard operation
forge copied to clipboard

Webpack Plugin: Configure node integration per renderer

Open johannesgiani opened this issue 4 years ago • 0 comments

Pre-flight checklist

  • [X] I have read the contribution documentation for this project.
  • [X] I agree to follow the code of conduct that this project uses.
  • [X] I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Problem description

I'd like to use multiple renderers with different configurations for context isolation and node integration in a project with webpack & typescript. This is currently not possible because all renderers share the same forge config and are bundled with the same webpack configuration.

Proposed solution

Bundle each renderer separately, so the webpack target can be defined per renderer.

Alternatives considered

Extend webpack plugin in a way that additional bundles besides main and render can be created.

Additional information

Use cases:

  • Hidden renderers that require node APIs while the UI renderer has context isolation and disabled node integration
  • WebWorkers with node integration in a renderer with context isolation and disabled node integration

johannesgiani avatar Oct 07 '21 19:10 johannesgiani