Cordova 5.0.0: Which files should I commit to git?

后端 未结 7 850
南方客
南方客 2021-01-30 02:47

I use Cordova 5.0.0 and i have the following project structure:

MyProject
    - hooks
    - platforms
    - plugins
    - resources
    - www
    - config.xml
         


        
7条回答
  •  轮回少年
    2021-01-30 03:20

    Most of the other answers are 2/3 years old.

    2019 Update:

    # remove extension less files
    *
    !/**/
    !*.*
    
    # intermediate files
    node_modules/
    build/
    obj/
    Debug/
    bin/
    package-lock.json
    .vs
    .gradle
    .idea
    *.exe
    
    # res
    **/resources/signing
    
    # project specific
    **/dist/
    **/all.min.js
    
    # ========== Cordova - platforms
    # android
    # platforms/android/app/src/main/assets
    # platforms/android/app/src/main/AndroidManifest.xml
    # platforms/android/app/src/main/res/drawable-*
    # platforms/android/app/src/main/res/mipmap-*
    # platforms/android/app/src/main/res/xml/config.xml
    # browser
    # platforms/browser/app/src/main/assets
    # platforms/browser/config.xml
    # platforms/browser/www
    #
    # ========== Cordova - plugins - remove all except json & xml
    # plugins/**/.DS_Store
    # plugins/**/*.cs
    # plugins/**/*.h
    # plugins/**/*.java
    # plugins/**/*.js
    # plugins/**/*.m
    # plugins/**/*.map
    # plugins/**/*.md
    # plugins/**/*.modulemap
    # plugins/**/*.ts
    # plugins/**/LICENSE
    # plugins/**/NOTICE
    # plugins/**/*.gradle
    # plugins/**/tests/
    

    As you can see I commented most of the lines ( all lines starting with # ). This is because I ran into issues with plugin version changes, and decided to know what is happening with plugin updates. Essentially all platform & plugin files are included in commit, now my life is peaceful.

    2019:
    I stated with this.

    After developing & publishing the app, it became below:
    (If you deviate from below, comment below, we can learn from each other)

    # remove extension less files
    *
    !/**/
    !*.*
    
    # intermediate files
    node_modules/
    build/
    obj/
    Debug/
    bin/
    package-lock.json
    .vs
    .gradle
    .idea
    *.exe
    
    # Cordova - platforms
    platforms
    
    # Cordova - plugins - remove all except json & xml
    plugins/**/.DS_Store
    plugins/**/*.cs
    plugins/**/*.h
    plugins/**/*.java
    plugins/**/*.js
    plugins/**/*.m
    plugins/**/*.map
    plugins/**/*.md
    plugins/**/*.modulemap
    plugins/**/*.ts
    plugins/**/LICENSE
    plugins/**/NOTICE
    plugins/**/*.gradle
    plugins/**/tests/
    
    # res
    **/resources/signing
    
    # project specific
    **/dist/
    **/all.min.js
    

提交回复
热议问题