Skip to content

WebpackOptionsValidationError configuration.target electron-preload #1873

@leongrdic

Description

@leongrdic

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:

preloadConfig.target('electron-preload')

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions