WebpackOptionsValidationError configuration.target electron-preload
leongrdic opened this issue · comments
I'm getting the following error from webpack when i try to add preload: 'src/preload.js'
to my vue.config.js
:
WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.target should be one of these:
"web" | "webworker" | "node" | "async-node" | "node-webkit" | "electron-main" | "electron-renderer" | function
...
I'm using Webpack 4.28.4 which apparently doesn't support the electron-preload
target that's currently hardcoded in this plugin:
vue-cli-plugin-electron-builder/index.js
Line 683 in 6a7b3ab
When I manually change the line above to 'electron-renderer', everything works as expected.
What are my options, how can I avoid this error and preload the file?
The plugin is using webpack 4.46 right now. So try to update. Though I think it has worked with older webpack 4.x too.
How would you suggest I do that? I don't have webpack anywhere in my package.json
.
I found that electron-preload
has been introduced in Webpack v4.33.0 (https://github.com/webpack/webpack/releases/tag/v4.33.0)
Shouldn't this plugin's minimum webpack version be at least 4.33.0 then? (sorry if I got something wrong)