0

实用antd搭建的项目首次进页面的时候出现白屏,调试看到报错:
如图:
图片描述
“index.js:99 Uncaught (in promise) Error: Loading chunk 1 failed.”

at HTMLScriptElement.onScriptComplete (index.js:99)

网上说是publicPath配置改成“/”。配置项写了依然有这种报错。

配置如下:
export default {

"entry": "./src/index.js",
"outputPath": "./dist",
"disableCSSModules": true,
"hash": false,
"theme": {
    "@primary-color": "#1DA57A",
    "@link-color": "#1DA57A",
    "@border-radius-base": "2px",
    "@font-size-base": "16px",
    "@line-height-base": "1.2"
},
"sass": {
    "includePaths": ['src/assets/scss/'],
    "outputStyle": "compressed"
},
"extraBabelPlugins": [
    ["import", { "libraryName": "antd-mobile", "style": true }]
],
"browserslist": [
    "> 1%",
    "Android >= 4",
    "iOS >= 8"
],
"publicPath": "/",
"env": {
    "development": {
        "publicPath": "/"
    }
},
"proxy": {
    ...
}

}

2018-05-04 提问
0 个回答

撰写答案

推广链接