Vue2.0打包后打开出现空白页解决方法
hash模式下:
修改\node_modules@vue\cli-service\lib\options.js.js:
\\修改前:
exports.defaults = () => ({
// project deployment base
publicPath: '/',
// where to output built files
outputDir: 'dist',
// where to put static assets (js/css/img/font/...)
assetsDir: '',
// filename for index.html (relative to outputDir)
indexPath: 'index.html',
// whether filename will contain hash part
filenameHashing: true,
// boolean, use full build?
runtimeCompiler: false,
)}
\\修改后
publicPath: './',
history模式下:
修改配置服务器的代理在找不到对应url时指向index.html即可