forge icon indicating copy to clipboard operation
forge copied to clipboard

Can't set webpack config of preload file

Open seamory opened this issue 2 years ago • 2 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 bug that matches the one I want to file, without success.

Electron Forge version

6.1.1

Electron version

17.4.11

Operating system

Window 10 (19045)

Last known working Electron Forge version

unkonw

Expected behavior

Preload js should wrap by webpack.

Actual behavior

Not do the expected behavior.

Steps to reproduce

      renderer: {
        config: rendererConfig,
        entryPoints: [
          {
            js: './src/main.ts',
            name: 'main',
            preload: {
              js: './electron/preload.js',
              config: {
                entry: "./electron/preload.js",
                output: {
                  path: path.resolve(__dirname, ".webpack/main"),
                  filename: '[name].js',
                },
                resolve: {
                  extensions: [".js"],
                }
              },
            },
          },
        ],
      },

I'm sure that main and renderer webpack output not clean up work directory.

Additional information

No response

seamory avatar May 04 '23 07:05 seamory

Hello, is there any one who have the same problem?

seamory avatar May 11 '23 09:05 seamory

Yes, I have the same problem. I need to have separate webpack configs for renderer and preload scripts. Renderer webpack config include frontend framework plugins, that are not needed in preload script.

euglv avatar Jul 25 '24 20:07 euglv