how can I use fs in react with electron?

前端 未结 2 1393
难免孤独
难免孤独 2021-02-07 12:55

I want use react+webpack+electron to build a desktop app.How can I inject fs module into react so that I can use it to read native files? I have a component such as

2条回答
  •  别跟我提以往
    2021-02-07 13:16

    The easiest thing to do is probably to use webpack-target-electron-renderer, you can find examples of using it in electron-react-boilerplate.

提交回复
热议问题