2016-08-26 3 views
0

나는 grunt를 사용하여 로컬 서버를 만들고 있습니다. 그러나 내가 grunt 명령을 실행할 때 연결 작업을 찾을 수 없습니다. 어느 누구도이 문제에 도움을받을 수 있습니까?작업 연결을 찾을 수 없습니다. grunt

참고 : stackoverflow와 google을 검색했습니다.

그런트 JS 파일

module.exports = function(grunt) { 
grunt.initConfig({ 

    pkg: grunt.file.readJSON, 

    clean: ["lib/tictactoe/build"], 

    connect:{ 
     all:{ 
      options:{ 
       port:9000, 
       hostname:'localhost' 
      } 
     } 
    } 


}) 


grunt.loadNpmTasks('grunt-contrib-clean','grunt-contrib-connect'); 
grunt.registerTask('default', ['clean','connect']); 
} 

Package.JSON는

{ 
"name": "gruntang", 
    "private": true, 
    "devDependencies": { 
"autoprefixer-core": "^5.2.1", 
"grunt": "^0.4.5", 
"grunt-angular-templates": "^0.5.7", 
"grunt-concurrent": "^1.0.0", 
"grunt-contrib-clean": "^0.6.0", 
"grunt-contrib-compass": "^1.0.0", 
"grunt-contrib-concat": "^0.5.0", 
"grunt-contrib-connect": "^0.9.0", 
"grunt-contrib-copy": "^0.7.0", 
"grunt-contrib-cssmin": "^0.12.0", 
"grunt-contrib-htmlmin": "^0.4.0", 
"grunt-contrib-imagemin": "^1.0.0", 
"grunt-contrib-jshint": "^0.11.0", 
"grunt-contrib-uglify": "^0.7.0", 
"grunt-contrib-watch": "^0.6.1", 
"grunt-filerev": "^2.1.2", 
"grunt-google-cdn": "^0.4.3", 

"jshint-stylish": "^1.0.0" 
}, 
"engines": { 
    "node": ">=0.10.0" 
} 
} 

답변

1

당신은 loadNpmTasks에 별도의 호출을해야합니다

grunt.loadNpmTasks('grunt-contrib-clean'); 
grunt.loadNpmTasks('grunt-contrib-connect'); 

당신은 하나를로드 할 수 있습니다 (PL) 한 번에 ugin은 loadNpmTasks입니다.

+0

도움을 주셔서 감사합니다. 나는 그것을 놓쳤습니다. – user3045179

관련 문제