vueパッケージ後のdistページの空白


プロジェクト内の自分のVUEプロジェクトは、npm run buildにより生成するdistファイルをパッケージ化し、ローカルdistフォルダのindexを開く.htmlページが空白です.この主な原因は経路の問題である.
1、configの下のindexを直してください.jsでbulidモジュールがエクスポートしたパス.なぜならhtmlの中の内容はscriptラベルで導入されていますが、あなたのパスが間違っていて、開くのは空白に違いありません.まずデフォルトのパスを見てみましょう. 

   
   
   
   
  1. module. exports = {
  2. build: {
  3. env: require( './prod.env'),
  4. index: path.resolve(__dirname, '../dist/index.html'),
  5. assetsRoot: path.resolve(__dirname, '../dist'),
  6. assetsSubDirectory: 'static',
  7. assetsPublicPath: '/',
  8. productionSourceMap: true,

assetsPublicPath   ‘/’  。 index.html static 。    ‘./ ’