问题
I am using grunt-serve and trying to change the default path, in my initConfig I use the following
serve: {
path: '/mypath'
},
Then when I visit localhost:9000 I still seeing the files and folders of the gruntfile.js root folder. I want to change the root path to /mypath and make all links relative to that. Also when I visit folder that has an index.html file I want the server to display it.
回答1:
You need to set options.serve.path
, not path
grunt.initConfig({
serve: {
options: {
serve: {
path: '/mypath'
}
}
},
});
来源:https://stackoverflow.com/questions/30599385/grunt-serve-change-default-path