Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm run build之后相对路径不对,搭建后白屏。 #11

Open
f2game opened this issue Jun 9, 2020 · 1 comment
Open

npm run build之后相对路径不对,搭建后白屏。 #11

f2game opened this issue Jun 9, 2020 · 1 comment

Comments

@f2game
Copy link

f2game commented Jun 9, 2020

我试了直接npm run build,搭建之后是白屏。 dev和init是正常可用的。

然后假如我想全用相对路径,然后index和其他文件在同一个输出目录 project/dist并且以此目录作为web服务主目录,需要做如下修改,但是修改后还是有问题:
webpack.prod.config.js:
第15行:
publicPath: '/dist/',
改成
publicPath: './',

第39行:
filename: '../index_prod.html',
改成
filename: './dist/index.html',


build后发现 项目/dist/vendors.[hash].js里搜索到一个="/dist/",但是手动改成了"./"之后,网页依然是白屏,请问贵公司发布这项目的时候,build后是否能正常显示?

@yonjar
Copy link

yonjar commented Sep 27, 2020

放弃使用这个demo项目吧
用最新的vue-cli create一个项目再安装viewui依赖直接就能跑起来了..build完出来的dist目录结构还好看多了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants