浏览代码

add a grunt plugin to check accessibility

l50741 8 年之前
父节点
当前提交
03ad87d651
共有 2 个文件被更改,包括 10 次插入0 次删除
  1. 9 0
      Gruntfile.js
  2. 1 0
      package.json

+ 9 - 0
Gruntfile.js

@@ -50,6 +50,7 @@ module.exports = function (grunt) {
     grunt.loadNpmTasks("grunt-chmod");
     grunt.loadNpmTasks("grunt-exec");
     grunt.loadNpmTasks("grunt-execute");
+    grunt.loadNpmTasks("grunt-accessibility");
 
 
     // Project configuration
@@ -133,6 +134,14 @@ module.exports = function (grunt) {
                 ],
             }
         },
+        accessibility: {
+            options: {
+                accessibilityLevel: "WCAG2A"
+            },
+            test: {
+                src: ["build/**/*.html"]
+            }
+        },
         webpack: {
             options: {
                 plugins: [

+ 1 - 0
package.json

@@ -35,6 +35,7 @@
     "extract-text-webpack-plugin": "^2.1.0",
     "file-loader": "^0.10.1",
     "grunt": ">=0.4.5",
+    "grunt-accessibility": "~5.0.0",
     "grunt-chmod": "~1.1.1",
     "grunt-contrib-clean": "~1.0.0",
     "grunt-contrib-copy": "~1.0.0",