grunt-serve change default path

匆匆过客 提交于 2019-12-11 10:18:54

问题


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

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