【问题标题】:Which files generated from Ionic do I include in source control?从 Ionic 生成的哪些文件包含在源代码管理中?
【发布时间】:2017-12-21 07:25:06
【问题描述】:

我使用这个命令生成了一个新的空白 Ionic 项目: 离子启动新应用空白--v1

我生成了以下文件和文件夹:

我不确定应该从源代码管理中包含或排除哪些。

【问题讨论】:

    标签: git ionic-framework version-control


    【解决方案1】:

    我喜欢 Ionic 自己在example apps 上遵循的布局:

    resources/
    src/
    www/
    .editorconfig
    .gitignore
    config.xml
    ionic.config.json
    package.json
    tsconfig.json
    tslint.json
    

    这消除了可使用 npm install 重建的 node_modules 以及也可重建的 platformplugins 目录的混乱。

    如果您想遵循此布局,您的.gitignore 可能如下所示:

    .sass-cache/
    .tmp/
    .versions/
    coverage/
    dist/
    node_modules/
    tmp/
    temp/
    hooks/
    platforms/
    plugins/
    plugins/android.json
    plugins/ios.json
    

    【讨论】:

      【解决方案2】:

      在一个新的项目文件夹中执行“npm install”时,我也收到此消息,上面只有 Grayson Kent 的结构:

      npm notice created a lockfile as package-lock.json. You should commit this file.
      

      所以 package-lock.json 也应该提交给您的源代码管理。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2019-02-02
        • 2015-05-07
        • 2016-11-16
        • 1970-01-01
        • 1970-01-01
        • 2010-11-19
        • 1970-01-01
        相关资源
        最近更新 更多