简体   繁体   中英

How to write a grunt task to build requirejs based Angular application

I'm currently working on an Angularjs based project.I am using RequireJs library to load dependencies asynchronously.

Following is my project structure :

  • index.html
    • vendors
      • angular.js
      • require.js
      • underscore.js
    • css
      • bootstrap.css
      • app.cs
    • images
    • App
      • app.js
      • signup
        • signup.controller.js
        • api.user.resource.js
        • user.service.js
        • templates
          • Login.html
      • profile
        • profile.controller.js
        • api.myprofile.resource.js
        • myprofile.resource.js
        • templates
          • profile.html

How can I combine all files inside of App folder into a single minifieds app.js file.Please help me to create a Grunt Task

Have a look at https://github.com/jrburke/almond . It is a minimal AMD API implementation designed for use with optimized builds. For packaging require applications with Grunt use https://github.com/gruntjs/grunt-contrib-requirejs .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM