Bufferパッケージのimportについて
#16
Answered
by
lacolaco
ver-1000000
asked this question in
Questions
|
Angularでは、Node.jsの Warning: /home/akai/Projects/pokemon-sandwich-recipes/src/app/app.component.ts depends on 'buffer'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependenciesこれについて、例えば次のようなIssueが立てられてcloseされています。 Node.jsのBufferモジュールはCommonJS形式であるため、このエラーが出る理屈は分かりますが、 ちなみに、私の今回の用途は「Buffer.fromを用いてbase64のエンコード/デコードを行う」のみです。 |
Answered by
lacolaco
Jan 16, 2023
Replies: 1 comment 1 reply
|
個人的な意見ですがNode.jsのAPIをそのままAngularアプリで使うことはないです。Node.jsのBufferはブラウザ用のAPIじゃないので https://www.npmjs.com/package/js-base64 とかのブラウザ向けライブラリを使うことがほとんどです |
1 reply
Answer selected by
ver-1000000
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
個人的な意見ですがNode.jsのAPIをそのままAngularアプリで使うことはないです。Node.jsのBufferはブラウザ用のAPIじゃないので https://www.npmjs.com/package/js-base64 とかのブラウザ向けライブラリを使うことがほとんどです