ES6 syntax import Electron (require..)

后端 未结 3 936
离开以前
离开以前 2020-12-10 01:32

To learn the new ES6 syntax, I\'ve been trying to refactor some JS code.

I\'m absolutely confused though by the whole import / export methods.

How do I chang

3条回答
  •  一生所求
    2020-12-10 01:52

    These days every version of Electron comes with basic typescript support. So if you use a TS or TSX file in your project -then you can use ES Import statements inside that file. Whether you use an ES module or not.

    https://www.electronjs.org/blog/typescript

提交回复
热议问题