Ionic / bower / cordova - ignore files for build

前端 未结 4 892
梦如初夏
梦如初夏 2021-02-07 10:36

My project structure is the following:

MyApp
  - hooks
  - platforms
     - android
     - ios
  - www
    - js / css / templates..
    - lib (including all bowe         


        
4条回答
  •  渐次进展
    2021-02-07 11:06

    With Bower you need to use npm preen to remove unnecessary files

    See my example using Gulp with Ionic Framework: https://github.com/jdnichollsc/Ionic-Starter-Template

    Basically you can set your bower.json file to indicate the path which files you need, for example:

    "preen": {
        //... More libraries
        "ionic-datepicker": [
            "dist/*.js" //You only need these files
            //Other files and folders will be deleted to reduce the size of your app
        ],
        "ion-floating-menu": [
            "dist/*" //Keep all the files (.html, .css, .js, etc) of the directory.
        ]
    }
    

    Regards, Nicholls

提交回复
热议问题