Tamas
Tamas

Reputation: 43

How to reference node fs API with electron in typescript?

I've created an electron app based on this link (but using recent modules).

I want to create a simple desktop app, I need to open some local files. I know that there is the node fs API for this, but I'm have problems with referencing it correctly.

Here is what I tried:

I'm new to this topic, and I would appreciate if someone could help me how to reference node's fs API correctly.

Upvotes: 4

Views: 4163

Answers (1)

Vadim Macagon
Vadim Macagon

Reputation: 14847

You need to set target: 'electron-renderer' in your Webpack config, if you still have issues after that take a look at https://github.com/chentsulin/electron-react-boilerplate

Upvotes: 3

Related Questions