如何使用express和angular来编写gruntfile

时间:2014-04-19 17:10:52

标签: express gruntjs pug grunt-usemin

我刚开始学习Grunt,遇到很多问题,我使用Express和Angular,我的项目目录如下

|-server
  |-controllers
  |-routes
  |-models
  |-views
    |-users
      signin.jade
      signup.jade
    index.jade  //Index of server

|-public
  |-images
  |-javascripts
    |-controllers
    |-services
    |-directives
    app.coffee
  |-stylesheets
    app.scss
  |-views //Angularjs templates

gruntfile.js  
server.js

我的index.jade可能如下

//- css, will use cdn files in production
link(href='bower_cmps/normalize-css/....')
link(href='bower_cmps/bootstrap/....')
link(href='stylesheets/app.css')

//- body
.container
  .row
    ...

//- scripts, will use cdn files in production
script(src='bower_cmps/jquery/...')
script(src='bower_cmps/angular/...')
script(src='bower_cmps/angular-ui-router/...')

script(src='javascripts/app.js')
script(src='javascripts/controllers/**.js')
script(src='javascripts/services/**.js')

我使用coffeescript编写客户端js,并使用scss编写css

Grunt dev配置是什么样的?

如何使用usemin构建生产文件?

感谢您提示

1 个答案:

答案 0 :(得分:1)

您熟悉Yeoman吗?有一堆Angular + Express生成器,请看generator-angular-fullstack

相关问题