修改vue中的挂载页面(index.html)的路径

修改vue中的挂载页面(index.html)的路径

 版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/VegasLemon/article/details/88910013

vue中的挂载页面index.html路径是在webpack.dev.conf.js下配置的,

找到plugins下面的

  1.  
    new HtmlWebpackPlugin({
  2.  
    filename: 'index.html',
  3.  
    template: 'index.html',
  4.  
    inject: true
  5.  
    }),

以上便是挂载页面的配置,其中
filename是输出的文件名,默认是index.html
template是依赖的模板,修改这个就能改变挂载的模板路径

例如

  1.  
    new HtmlWebpackPlugin({
  2.  
    filename: 'index.html',
  3.  
    template: 'src/index.html',
  4.  
    inject: true
  5.  
    }),

以上配置将启用src下的index.html路径。

posted on 2019-07-25 16:52  newlives  阅读(9642)  评论(0编辑  收藏  举报