Skip to content

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

@f2game

Description

@f2game

我试了直接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后是否能正常显示?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions