react 如何 build 成一个 html 文件

2021-02-27 10:22:58 +08:00
 deeprobe

build 后 static 里有 js 和 css 等文件,有没有打包命令可以把 static 打包进一个 html 文件里去?

1381 次点击
所在节点    问与答
3 条回复
throns
2021-02-27 11:41:05 +08:00
可以写个 gulp 脚本替换,看看这个文章 https://www.labnol.org/code/bundle-react-app-single-file-200514
EridanusSora
2021-02-27 17:54:32 +08:00
html-webpack-plugin
deeprobe
2021-03-03 13:56:34 +08:00
@throns 多谢多谢,很好用。就是打成的文件体积挺大。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/756686

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX