deeprobe
V2EX  ›  问与答

react 如何 build 成一个 html 文件

  •  
  •   deeprobe · Feb 27, 2021 · 2201 views
    This topic created in 1921 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   ·   971 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 93c8b4a0 · 46ms · UTC 20:24 · PVG 04:24 · LAX 13:24 · JFK 16:24
    ♥ Do have faith in what you're doing.