V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
deeprobe
V2EX  ›  问与答

react 如何 build 成一个 html 文件

  •  
  •   deeprobe · Feb 27, 2021 · 2121 views
    This topic created in 1888 days ago, the information mentioned may be changed or developed.

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

    throns
        1
    throns  
       Feb 27, 2021 via iPhone
    可以写个 gulp 脚本替换,看看这个文章 https://www.labnol.org/code/bundle-react-app-single-file-200514
    EridanusSora
        2
    EridanusSora  
       Feb 27, 2021 via Android
    html-webpack-plugin
    deeprobe
        3
    deeprobe  
    OP
       Mar 3, 2021
    @throns 多谢多谢,很好用。就是打成的文件体积挺大。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2753 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 13:17 · PVG 21:17 · LAX 06:17 · JFK 09:17
    ♥ Do have faith in what you're doing.