Change grunt serve default path

2019-08-03 16:51发布

I use grunt-serve and access the files that it serves through localhost:9000, I want to change that to

localhost:9000/mypath

I read on the documentation that I can do the following

'serve': {
    'path': '/Users/user/Documents/workspace/project'
}

But I don't know where to put this options.

I have found a similar question but no answers.

标签: gruntjs
1条回答
The star\"
2楼-- · 2019-08-03 17:36

The configuration block for the grunt-serve plugin should reside (as with any other task configuration) in the config object passed to grunt.config.init, e.g.:

grunt.config.init({
    serve: {
        path: '/Users/user/Documents/workspace/project'
    },
    // ...
});
查看更多
登录 后发表回答