V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
deeprobe
V2EX  ›  问与答

react 如何 build 成一个 html 文件

  •  
  •   deeprobe · 2021-02-27 10:22:58 +08:00 · 1381 次点击
    这是一个创建于 1158 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    throns
        1
    throns  
       2021-02-27 11:41:05 +08:00 via iPhone
    可以写个 gulp 脚本替换,看看这个文章 https://www.labnol.org/code/bundle-react-app-single-file-200514
    EridanusSora
        2
    EridanusSora  
       2021-02-27 17:54:32 +08:00 via Android
    html-webpack-plugin
    deeprobe
        3
    deeprobe  
    OP
       2021-03-03 13:56:34 +08:00
    @throns 多谢多谢,很好用。就是打成的文件体积挺大。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3129 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 10:33 · PVG 18:33 · LAX 03:33 · JFK 06:33
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.