Change grunt serve default path

∥☆過路亽.° 提交于 2019-12-11 12:28:12

问题


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.


回答1:


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'
    },
    // ...
});


来源:https://stackoverflow.com/questions/30595778/change-grunt-serve-default-path

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!