當我們爲生產中使用命令創建構建我得到離子新的錯誤離子科爾多瓦構建Android --prod
ionic cordova build --prod
它總是給人一個錯誤在NGC點開始
Running app-scripts build: --prod
[15:00:23] build prod started ...
[15:00:23] clean started ...
[15:00:23] clean finished in 36 ms
[15:00:23] copy started ...
[15:00:23] ngc started ...
Error: Type DashboardPage in /Users/sunny/Desktop/Apps/IONIC/MintOld/src/pages/dashboard/dashboard.ts
is part of the declarations of 2 modules: AppModule in
/Users/sunny/Desktop/Apps/IONIC/MintOld/src/app/app.module.ts and
DashboardPageModule in /Users/sunny/Desktop/Apps/IONIC/MintOld/src/pages/dashboard/dashboard.module.ts!
Please consider moving DashboardPage in
/Users/sunny/Desktop/Apps/IONIC/MintOld/src/pages/dashboard/dashboard.ts to a
higher module that imports AppModule in
/Users/sunny/Desktop/Apps/IONIC/MintOld/src/app/app.module.ts and
DashboardPageModule in /Users/sunny/Desktop/Apps/IONIC/MintOld/src/pages/dashboard/dashboard.module.ts.
You can also create a new NgModule that exports and includes DashboardPage in
/Users/sunny/Desktop/Apps/IONIC/MintOld/src/pages/dashboard/dashboard.ts
then import that NgModule in AppModule in
/Users/sunny/Desktop/Apps/IONIC/MintOld/src/app/app.module.ts
and DashboardPageModule in /Users/sunny/Desktop/Apps/IONIC/MintOld/src/pages/dashboard/dashboard.module.ts.