Vue cli3 中打包配置基礎問題
- cli3捨棄了baseUrl 直接使用 publicPath
- outputDir 可寫可不寫(如果你要重新命名自己的檔名)
- assetsDir 不寫的話會將css/js/font資料夾生成在根目錄下,寫了就會整合在你命名的資料夾裡

Vue cli3 + TomCat 解決history模式下的404問題


TomCat官網下載:tomcat.apache.org/
下載後 開啟所在資料夾
- 找到bin 資料夾

2.找到startup.bat 雙擊 等待cmd視窗載入完成

3.返回根目錄裡,找到webapps資料夾點選後開啟ROOt資料夾並清空


4.將自己npm run build 生成的dist資料夾裡面的東西拷貝到清空後的Root資料夾裡

之後在瀏覽器中輸入localhost:8080,就可以看到並測試了
