vue 发布build 本地设置 相对路径 两个地方 一个根目录用./ css文件里面用../../

build: { // Template for index.html index: path.resolve(__dirname, ‘../dist/index.html‘), // Paths assetsRoot: path.resolve(__dirname, ‘../dist‘), assetsSubDirectory: ‘../../static‘, assetsPublicPath: ‘./‘,

  config/index.js

 

问题是这样改完了,根index.html路径也不对,最后还是得手改

<!DOCTYPE html><html><head> <meta charset=utf-8> <meta name=viewport content="width=device-width,initial-scale=1"> <title>iviewdemo</title> <link href=./../../static/css/app.0a6ba3b3dba53fc983a09ef477b088f9.css rel=stylesheet></head><body> <div id=app></div> <script type=text/javascript src=./../../static/js/manifest.06afec52e97ebf804504.js> </script> <script type=text/javascript src=./../../static/js/vendor.863170c738aad3e88771.js> </script> <script type=text/javascript src=./../../static/js/app.2ca91cd92c83d3402260.js> </script> </body> </html>

  

相关文章