在Gatsby网站上读取文件?

问题描述

我很困惑如何在Gatsby框架中读取文件(特别是.docx文件)。目前,我正在尝试使用browserify-fs并将.docx文件放置在static文件夹中。但是我一直收到此错误

InternalError: The filetype for this file Could not be identified,is this file corrupted ?

这就是我使用browserify-fs的方式:

import fs from "browserify-fs"
var content = fs.readFile("../../static/Hello.docx","binary"

谢谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)