2016-04-23 8 views
0

EaselJSでゲーム開発用にプロジェクトを構成する際に問題が発生しています。以下は私のGrunt.jsファイルです。EaselJSプロジェクトの設定中にgruntコマンドでサーバーが実行されない

module.exports = function(grunt) { 

// Project configuration. 
grunt.initConfig({ 
    pkg: grunt.file.readJSON('package.json'), 
    browserify: { 
     build: { 
      files: { 
       'build/scripts/app.bundle.js': ['app/lib/main.js'] 
      } 
     } 
    }, 
    copy: { 
     scripts: { 
      src: [ 
       'bower_components/easeljs/lib/easeljs-0.8.0.combined.js', 
      ], 
      dest: 'build/scripts/', 
      expand: true, 
      flatten: true 
     }, 
     html: { 
      src: [ 
       'app/index.html', 
      ], 
      dest: 'build/', 
      expand: true, 
      flatten: true 
     } 
    }, 
    connect: { 
     server: { 
      options: { 
       port: 9001, 
       base: 'build' 
      } 
     } 
    }, 
    watch: { 
     options: { 
      livereload: true 
     }, 
     scripts: { 
      files: ['app/lib/**/*.js', 'app/*.html'], 
      tasks: ['build'] 
     } 
    } 
}); 

// Load the plugin that provides the "uglify" task. 
grunt.loadNpmTasks('grunt-contrib-copy'); 
grunt.loadNpmTasks('grunt-contrib-watch'); 
grunt.loadNpmTasks('grunt-contrib-connect'); 
grunt.loadNpmTasks('grunt-browserify'); 

// Default task(s). 
grunt.registerTask('build', ['browserify', 'copy']); 
grunt.registerTask('default', ['build', 'connect', 'watch']);}; 

コマンドラインでgruntコマンドを実行するたびに、Windowsは「このファイルを開く方法」を尋ねます。ブラウザを選択すると、Grunt.jsファイルが開き、表示されます。

この問題を解決する手助けをすれば本当に感謝します。ありがとう

答えて

1

私はそれを考え出しました。私はファイルGrunt.jsGruntfile.jsの代わりに付けました。 Gruntfile.jsに変更し、gruntコマンドを実行しましたが、期待どおりに動作していました。

関連する問題