How can I get the Amazon Cognito Identity SDK working in Aurelia?

牧云@^-^@ 提交于 2019-12-05 02:59:38

Try the compiled library instead, using the compiled lib bundled just fine. Also the library seems to define window.AWS, so injecting it or not will work

{
    "name": "aws-sdk",
    "path": "../node_modules/aws-sdk/dist",
    "main": "aws-sdk.min",
    "exports": "AWS"
}

UPDATE:

It seems the only way to import those libraries is by using the prepend section, the libraries write to the window variable so it can still be accesible to your app scripts, only by not importing them like ES6 modules.

    "prepend": [
      "node_modules/aws-sdk/dist/aws-sdk.min.js",
      "node_modules/amazon-cognito-identity-js/dist/aws-cognito-sdk.min.js",
      "node_modules/amazon-cognito-identity-js/dist/amazon-cognito-identity.min.js",
      "node_modules/bluebird/js/browser/bluebird.core.js",
      "scripts/require.js"
    ],
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!