更改grunt服务默认路径 [英] Change grunt serve default path
本文介绍了更改grunt服务默认路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用grunt-serve并通过
localhost:9000访问它提供的文件,我想将其更改为
I use grunt-serve and access the files that it serves through localhost:9000, I want to change that to
localhost:9000/mypath
我阅读了以下文档, / p>
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.
推荐答案
grunt-serve插件的配置块应该驻留在配置对象中(与任何其他任务配置一样) grunt.config.init
,例如:
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'
},
// ...
});
这篇关于更改grunt服务默认路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文