Feathers: Angular10の最適化警告

作成日 2020年06月28日  ·  3コメント  ·  ソース: feathersjs/feathers

再現する手順

AngularアプリケーションをAngular10.0.0にアップグレードすると、最適化のベイルアウトのためにcommonjsまたはAMDに依存しているモジュールとパッケージに警告が表示されます

警告のPSBログ

WARNING in src/app/core/services/feathers.service.ts depends on @feathersjs/socketio-client. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in src/app/core/services/feathers.service.ts depends on @feathersjs/feathers. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in src/app/core/services/feathers.service.ts depends on @feathersjs/authentication-client. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in src/app/core/services/feathers.service.ts depends on socket.io-client. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in src/app/core/services/feathers.service.ts depends on feathers-reactive. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

システム構成

モジュールバージョン
@ feathersjs / authentication-client: "^ 4.5.4"
@ feathersjs / feathers: "^ 4.5.3"
@ femalesjs / socketio-client: "^ 4.5.4"
socket.io-client: "^ 2.3.0"

NodeJSバージョン
ノード12

オペレーティングシステム
Linux mint 19.3

Client Feature

最も参考になるコメント

これらの警告を正しく修正するには、ESMビルドを追加する必要があります。

全てのコメント3件

こんにちはアーケンスタンよく私はangular.jsonファイルにこれを追加してその警告を解決します

`
"建築家": {
"建てる": {
"ビルダー": "@ angular-devkit / build- angular:browser "、
"オプション":{
"allowedCommonJsDependencies":[
「socket.io-client」、
「socket.io-parser」、
"デバッグ"
]、

`
また、あなたは#18025を見ることができます

これらの警告を正しく修正するには、ESMビルドを追加する必要があります。

同じ問題がありました警告:エントリポイントsimplebar-angularには深いインポートが含まれています
「build」=>「options」にangular.jsonを追加してみてください。

"allowedCommonJsDependencies":["core-js"]、

また、tsconfig.jsonに何かを追加したことを覚えています。
ここで役立ったのは、デフォルト設定での私のケースチェックです

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./public/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "module": "esnext",
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2015",
    "allowSyntheticDefaultImports": true,
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom"
    ]
  }
}
このページは役に立ちましたか?
0 / 5 - 0 評価