How to use FS module inside Electron.Atom\WebPack application?

前端 未结 2 347
借酒劲吻你
借酒劲吻你 2020-12-16 03:14

I need write some data in the file, using FS module (fs.writeFile). My stack is webpack + react + redux + electron.

The first problem was: Cannot resolve mod

2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-16 03:29

    Problem is solved.

    Need use in electron app (where you add the bundle):

    var remote = require('electron').remote;
    var electronFs = remote.require('fs');
    var electronDialog = remote.dialog;
    

提交回复
热议问题