Grunt を使用してサーバーを作成しようとすると、すぐにシャットダウンし、ブラウザーに移動してテストするための変更が行われません。
これは私の Grunt ファイル全体です。
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.initConfig({
connect: {
serve: {
options: {
port: 8081,
base: '/',
hostname: '*',
debug: true
}
}
}
});
grunt.registerTask('default', ['connect']);
}
実行すると、エラーなしで動作します。
C:\Users\Imray\my-sandbox>grunt
Running "connect:keepalive" (connect) task
Started connect web server on http://0.0.0.0:8000
Running "connect:serve" (connect) task
Started connect web server on http://0.0.0.0:8081