Ionic / bower / cordova - ignore files for build

前端 未结 4 807
梦如初夏
梦如初夏 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:23

    I think the best approach would be to do this:

    1. Move the bower_components folder and your index.html file to the project root, outside the /www folder
    2. Install gulp and gulp-usemin
    3. Wrap all of the .js files and .css files from bower components in usemin and sections
    4. Configure a task in your gulpfile to concatenate all those files into a lib.js and a lib.css file. Make sure that those two files as well as the rewritten index.html are output to the /www folder
    5. Execute the gulp task before your next build, and each time you add a new bower component.

    This will keep your /www folder tidy and only containing the files you need in your cordova build.

提交回复
热议问题