我希望在某个端口上启动index.html并希望它直接在chrom中打开
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 :(得分:0)
您需要加载任务:
grunt.loadNpmTasks('grunt-contrib-connect');