From da319a110feb23eeb2c008d8fbde180149946430 Mon Sep 17 00:00:00 2001 From: KinFeng Date: Tue, 24 Apr 2018 15:53:28 +0800 Subject: [PATCH] =?UTF-8?q?fs=E7=9A=84=E6=8E=A5=E5=8F=A3=E5=BA=94=E8=AF=A5?= =?UTF-8?q?=E6=98=AFreadFile=EF=BC=8C'f'=E6=94=B9=E6=88=90=E5=A4=A7?= =?UTF-8?q?=E5=86=99'F'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/module-loader.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/module-loader.md b/docs/module-loader.md index 030c40c..a5ee615 100644 --- a/docs/module-loader.md +++ b/docs/module-loader.md @@ -426,10 +426,10 @@ setTimeout(_ => module.exports = null); ```javascript // 不正确 -import { readfile } from 'fs'; +import { readFile } from 'fs'; ``` -上面的写法不正确,因为`fs`是 CommonJS 格式,只有在运行时才能确定`readfile`接口,而`import`命令要求编译时就确定这个接口。解决方法就是改为整体输入。 +上面的写法不正确,因为`fs`是 CommonJS 格式,只有在运行时才能确定`readFile`接口,而`import`命令要求编译时就确定这个接口。解决方法就是改为整体输入。 ```javascript // 正确的写法一