我尝试编译一个expo web应用程序,但在使用"expo build: web“编译结束后,当我使用"npx serve web-build”打开项目时,web浏览器显示以下屏幕:

我试图解决这个问题,配置wepack.config.js并启用离线模式,但没有解决任何问题。
//My webpack.config.js
const createExpoWebpackConfigAsync = require("@expo/webpack-config");
module.exports = async function (env, argv) {
const config = await createExpoWebpackConfigAsync(
{
...env,
// Passing true will enable the default Workbox + Expo SW configuration.
offline: true,
},
argv
);
// Customize the config before returning it.
return config;
};
我的app.json:
{
"expo": {
"name": "maqueta",
"slug": "maqueta",
"platforms": ["web"],
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
},
"web": {
"favicon": "./assets/favicon.png"
}
}
}
发布于 2021-08-19 20:18:29
只需添加-s
npx serve -s web-buildhttps://stackoverflow.com/questions/64137976
复制相似问题