2017-02-09 56 views
0
  1. 這是我的grunt文件。
  2. 我運行$咕嚕默認
  3. 實際工作中,我想我的index.html的一些端口上,並希望它在CHROM打開直接Gruntfile失敗,並顯示Warning:Task「default」not found

    module.exports = function(grunt) { 
        grunt.initConfig({ 
    connect: { 
        server: { 
         options: { 
         port: 9001, 
         base: { 
          path: 'Dev', 
          options: { 
          index: 'index.html', 
          maxAge: 300000 
          } 
         } 
         } 
        } 
        }, 
        open: { 
        delayed: { 
         path: 'http://localhost:9001' 
         app: 'Google Chrome' 
         options: { 
         openOn: 'serverListening' 
         } 
        } 
        }  
        }); 
    grunt.registerTask('default', ['connect', 'open']); 
    }; 
    

回答

0

你需要下載任務:

grunt.loadNpmTasks('grunt-contrib-connect'); 
相關問題