我正在尝试使用我尝试过的 Ionic 5 构建网络应用程序:
ionic cordova build browser --prod --release
Run Code Online (Sandbox Code Playgroud)
和
ionic serve --prod
Run Code Online (Sandbox Code Playgroud)
都失败并出现如下错误:
1. If 'ion-header' is an Angular component, then verify that it is part of this module.
2. If 'ion-header' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
1. If 'ion-icon' is an Angular component, then verify that it is part of this module.
2. If 'ion-icon' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the'@NgModule.schemas' of this component to suppress this message.
'ion-label' is
not a known element:
1. If 'ion-label' is an Angular component, then verify that it is part of this module.
2. If 'ion-label' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
Run Code Online (Sandbox Code Playgroud)
似乎在构建生产时,它没有重新识别离子成分。
当我使用以下命令时我很好:
ionic serve
Run Code Online (Sandbox Code Playgroud)
那么如何处理呢?谢谢
小智 7
为网络构建 ionic 代码的命令是ionic build。
如果您想构建生产代码,请使用 - ionic build --prod。
这会将所有 Ionic 代码构建到www文件夹中,您可以将其nginx与任何其他 Web 服务器一起使用。
| 归档时间: |
|
| 查看次数: |
7071 次 |
| 最近记录: |