Sfoglia il codice sorgente

The default grunt task now installs bower components, thus saving one step in the developer docs

Till Klocke 8 anni fa
parent
commit
dbccddbc22
3 ha cambiato i file con 17 aggiunte e 1 eliminazioni
  1. 1 1
      Gruntfile.js
  2. 1 0
      package.json
  3. 15 0
      tasks/build.js

+ 1 - 1
Gruntfile.js

@@ -17,7 +17,7 @@ module.exports = function (grunt) {
 
   grunt.loadTasks("tasks")
 
-  grunt.registerTask("default", ["lint", "saveRevision", "copy", "sass", "requirejs"])
+  grunt.registerTask("default", ["bower-install-simple", "lint", "saveRevision", "copy", "sass", "requirejs"])
   grunt.registerTask("lint", ["eslint"])
   grunt.registerTask("dev", ["default", "connect:server", "watch"])
 }

+ 1 - 0
package.json

@@ -15,6 +15,7 @@
     "grunt-contrib-uglify": "^0.5.1",
     "grunt-contrib-watch": "^0.6.1",
     "grunt-eslint": "^10.0.0",
+    "grunt-bower-install-simple": "^1.1.2",
     "grunt-git-describe": "^2.3.2"
   },
   "eslintConfig": {

+ 15 - 0
tasks/build.js

@@ -1,5 +1,6 @@
 module.exports = function(grunt) {
   grunt.config.merge({
+    bowerdir: "bower_components",
     copy: {
       html: {
         options: {
@@ -74,6 +75,19 @@ module.exports = function(grunt) {
         }
       }
     },
+    "bower-install-simple": {
+        options: {
+          directory: "<%=bowerdir%>",
+          color: true,
+          interactive: false,
+          production: true
+        },
+        "prod": {
+          options: {
+            production: true
+          }
+        }
+      },
     requirejs: {
       compile: {
         options: {
@@ -89,6 +103,7 @@ module.exports = function(grunt) {
     }
   })
 
+  grunt.loadNpmTasks("grunt-bower-install-simple")
   grunt.loadNpmTasks("grunt-contrib-copy")
   grunt.loadNpmTasks("grunt-contrib-requirejs")
   grunt.loadNpmTasks("grunt-contrib-sass")