vue的dist放到tomcat沒法訪問

vue的dist放到tomcat沒法訪問html

$ npm run build
...
  Tip: built files are meant to be served over an HTTP server.
  Opening index.html over file:// won't work.

vue的dist放到tomcat沒法訪問. 修改config/index.jsvue

//assetsPublicPath: '/',
    assetsPublicPath: './',// 增長一個點,不然npm run build後沒法查看

注意,改了assetsPublicPath後,npm run dev後不能訪問:chrome

Cannot GET /

參考: http://www.javashuo.com/article/p-hnpkmsbv-cc.htmlnpm

仍是不行. 打開chrome的控制檯.tomcat

Failed to load resource: the server responded with a status of 404 ()
http://130.51.23.12:8280/static/js/app.376299e7505d4fa250ba.js

漏了dist. 不要dist目錄,直接放到ROOT,成功了。 參考: http://www.javashuo.com/article/p-bpcdberj-ez.htmlapp

相關文章
相關標籤/搜索