Skip to content

Webpack and electron #3376

@bellostom

Description

@bellostom

Hi,

I have been developing an electron application, but been using a lot the browser during development.
I have 2 webpack configs, one for electron (with the appropriate target) and a second one for the web build.

The problem I came across is that when I import any electron modules, the web build fails with an error

ERROR in ./~/electron/index.js
Module not found: Error: Cannot resolve module 'fs'

I know it is electron related, because when I comment out the import everything works
I tried wrapping the imports in a if statement checking an environment variable, but this did not work either

Anyway, to make this work?

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions