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

前端是如何高效差异化的管理代码?

  •  
  •   nttisthebest · Jul 12, 2021 · 1930 views
    This topic created in 1760 days ago, the information mentioned may be changed or developed.

    我们公司有一个需求,两个项目使用的前端代码 90%都是一样的,如何进行合并管理?

    用到的技术栈:Vue+element

    另外的项目是:Vue+element+electron

    不想在主项目改了一些简单的逻辑和样式代码,还要再另一个 electron 项目进行更改,大佬们有什么办法吗?除了 git 分支之外

    4 replies    2021-07-13 15:00:10 +08:00
    shenyu1996
        1
    shenyu1996  
       Jul 12, 2021
    比如 scratch-gui 项目
    web 版 https://github.com/LLK/scratch-gui
    electron 分支 https://github.com/LLK/scratch-gui/tree/scratch-desktop

    electron 项目
    https://github.com/LLK/scratch-desktop
    在 package.json 中指向 scratch-gui electron 分支
    "scratch-gui": "github:LLK/scratch-gui#scratch-desktop-v3.24.0"

    web 版的特性可以直接向 electron 分支合并
    gouflv
        2
    gouflv  
       Jul 13, 2021 via iPhone
    monorepo
    rsyjjsn
        3
    rsyjjsn  
       Jul 13, 2021
    lenra
    wyvernnot
        4
    wyvernnot  
       Jul 13, 2021
    用不同的 webpack 配置文件试试
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   988 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 18:47 · PVG 02:47 · LAX 11:47 · JFK 14:47
    ♥ Do have faith in what you're doing.