forge icon indicating copy to clipboard operation
forge copied to clipboard

feat(plugin): add setup to rspack plugin

Open noghartt opened this issue 6 months ago • 3 comments

  • [x] I have read the contribution documentation for this project.
  • [x] 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:

The idea of this PR is to bring a new plugin allowing us to use the rspack as a possible bundler for Electron with forge tooling. By the fact that rspack has a similar API related for Webpack, it follows the same approach. As the example below:

    {
      name: '@electron-forge/plugin-rspack',
      config: {
        mainConfig: './rspack.main.config.js',
        renderer: {
          config: './rspack.renderer.config.js',
          entryPoints: [{
            name: 'main_window',
            html: './src/renderer/index.html',
            js: './src/renderer/index.js',
            preload: {
              js: './src/preload.js'
            }
          }]
        }
      }
    }

noghartt avatar Dec 23 '23 21:12 noghartt

Hi @noghartt. CI failed, can you fix it?

BlackHole1 avatar Dec 25 '23 01:12 BlackHole1

Hi @noghartt. CI failed, can you fix it?

ofc, i'll need to write more tests for these cases and fix the ci

it seems that the types aren't well matched yet

noghartt avatar Dec 25 '23 03:12 noghartt

It looks like a log of this code is duplicated, I wonder if there is a way we can write this plugin so it uses the webpack plugin impl but swaps out the underlying webpack calls for rspack to avoid massive duplication

MarshallOfSound avatar Dec 25 '23 03:12 MarshallOfSound