-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Webpack and electron #3376
Copy link
Copy link
Closed
Labels
Description
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
Reactions are currently unavailable