vueパッケージ後のdistページの空白
プロジェクト内の自分のVUEプロジェクトは、npm run buildにより生成するdistファイルをパッケージ化し、ローカルdistフォルダのindexを開く.htmlページが空白です.この主な原因は経路の問題である.
1、configの下のindexを直してください.jsでbulidモジュールがエクスポートしたパス.なぜならhtmlの中の内容はscriptラベルで導入されていますが、あなたのパスが間違っていて、開くのは空白に違いありません.まずデフォルトのパスを見てみましょう.
1、configの下のindexを直してください.jsでbulidモジュールがエクスポートしたパス.なぜならhtmlの中の内容はscriptラベルで導入されていますが、あなたのパスが間違っていて、開くのは空白に違いありません.まずデフォルトのパスを見てみましょう.
-
module.
exports = {
-
build: {
-
env: require(
'./prod.env'),
-
index: path.resolve(__dirname,
'../dist/index.html'),
-
assetsRoot: path.resolve(__dirname,
'../dist'),
-
assetsSubDirectory:
'static',
-
assetsPublicPath:
'/',
-
productionSourceMap:
true,
assetsPublicPath ‘/’ 。 index.html static 。 ‘./ ’