首先答姥,請先確認(rèn)你的所有引入的路徑為'./xxx'
1. 在config文件夾下,找到index.js?
1??? ? ? assetsPublicPath:'./'
2??? ? ? proxyTable: {
? ? ? '/api': {
? ? ? ? target: 'http://api.xinnet.com/domain/',
? ? ? ? changeOrigin: true,
? ? ? ? pathRewrite: {
? ? ? ? ? '^/api': ''
? ? ? ? }
? ? ? }
? ? }
1
2. 在build文件夾下的webpage.prod.config.js 找到output中寫一個publicPath:'./'
2
3. 在build文件夾下,找到utils.js 的?publicPath:?'../../'
3
4.npm? run build? 就可以了
(如果還想在本地run這個項目請把config文件夾下的index.js文件里的? assetsPublicPath:'./' 變成 =>???assetsPublicPath:'/'??)