From e576da90dd1e5b0a30c439058a579ccb84b11c8f Mon Sep 17 00:00:00 2001 From: zhoufeifan <937127883@qq.com> Date: Thu, 31 Mar 2022 15:02:52 +0800 Subject: [PATCH] chore: import on demand --- packages/renderer/src/samples/node-api.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/renderer/src/samples/node-api.ts b/packages/renderer/src/samples/node-api.ts index 001e540..0a1d7ce 100644 --- a/packages/renderer/src/samples/node-api.ts +++ b/packages/renderer/src/samples/node-api.ts @@ -1,5 +1,5 @@ - -import fs from 'fs' +import { lstat } from 'fs' +import { cwd } from 'process' import { ipcRenderer } from 'electron' // Usage of ipcRenderer.on @@ -7,7 +7,7 @@ ipcRenderer.on('main-process-message', (_event, ...args) => { console.log('[Receive Main-process message]:', ...args) }) -fs.lstat(process.cwd(), (err, stats) => { +lstat(cwd(), (err, stats) => { if (err) { console.log(err) } else {