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

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

  •  
  •   nttisthebest · 2021-07-12 22:12:18 +08:00 · 1105 次点击
    这是一个创建于 1012 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    用到的技术栈:Vue+element

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

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

    4 条回复    2021-07-13 15:00:10 +08:00
    shenyu1996
        1
    shenyu1996  
       2021-07-12 22:34:51 +08:00
    比如 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  
       2021-07-13 08:06:12 +08:00 via iPhone
    monorepo
    rsyjjsn
        3
    rsyjjsn  
       2021-07-13 09:19:07 +08:00
    lenra
    wyvernnot
        4
    wyvernnot  
       2021-07-13 15:00:10 +08:00
    用不同的 webpack 配置文件试试
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2852 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 09:33 · PVG 17:33 · LAX 02:33 · JFK 05:33
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.