vue項目部署到服務器

1、配置config目錄下index.js

    index: path.resolve(__dirname, '../dist/index.html'),
    assetsRoot: path.resolve(__dirname, '../dist'),
    assetsSubDirectory: 'static',
    assetsPublicPath: './',
    proxyTable: {},

紅色部分是添加,綠色部分是修改

2、使用下面命令開始構建

npm run build

3、構建成功後項目根目錄下,會創建一個dist文件夾,將裏面的index.html 和static目錄複製到服務器上tomcat目錄下的webappS/ROOT/下。重新啓動tomcat就可以正常訪問了

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章