Skip to content

Instantly share code, notes, and snippets.

@gsans
Last active June 2, 2023 16:28
Show Gist options
  • Select an option

  • Save gsans/8982c126c4fef668c094ff288f04241b to your computer and use it in GitHub Desktop.

Select an option

Save gsans/8982c126c4fef668c094ff288f04241b to your computer and use it in GitHub Desktop.
Remove CommonJS or AMD dependencies optimization bailouts warnings for AWS Amplify using Angular v10
"build": {
"builder": "@angular-devkit/build-angular:browser",
...
"options": {
"allowedCommonJsDependencies": ["crypto-js", "@aws-sdk/eventstream-marshaller", "buffer", "js-cookie",
"@aws-crypto", "zen-observable", "@aws-sdk/util-utf8-node", "@aws-crypto/sha256-js", "@aws-sdk/util-buffer-from",
"@aws-sdk/smithy-client", "@aws-sdk/middleware-serde", "@aws-sdk/middleware-user-agent",
"@aws-sdk/middleware-retry", "@aws-sdk/middleware-signing", "@aws-sdk/middleware-content-length",
"@aws-sdk/middleware-host-header", "@aws-sdk/config-resolver", "@aws-sdk/s3-request-presigner",
"@aws-sdk/util-format-url", "@aws-sdk/util-create-request", "@aws-sdk/property-provider",
"axios", "@aws-sdk/fetch-http-handler", "@aws-sdk/protocol-http", "@aws-sdk/querystring-builder",
"@aws-sdk/util-utf8-browser", "@aws-sdk/url-parser-browser", "@aws-crypto/sha256-browser",
"@aws-sdk/url-parser-node", "@aws-sdk/util-uri-escape", "@aws-sdk/middleware-sdk-s3",
"@aws-sdk/middleware-bucket-endpoint", "@aws-sdk/querystring-parser", "@aws-sdk/middleware-apply-body-checksum",
"@aws-sdk/middleware-ssec", "@aws-sdk/middleware-expect-continue", "fast-xml-parser",
"@aws-sdk/xml-builder", "@aws-sdk/md5-js", "@aws-sdk/hash-blob-browser",
"@aws-sdk/eventstream-serde-browser", "@aws-sdk/middleware-location-constraint", "uuid",
"events", "xstate/lib/waitFor.js", "style-dictionary/lib/utils/deepExtend.js",
"style-dictionary/lib/utils/flattenProperties.js", "style-dictionary/lib/utils/references/usesReference.js", "cookie"
"@aws-sdk/credential-provider-cognito-identity", "@aws-sdk/eventstream-serde-config-resolver",
"ulid", "zen-push", "lodash", "@aws-amplify/core", "url", "@aws-crypto/crc32", "isomorphic-unfetch",
"crypto-js/lib-typedarrays", "crypto-js/hmac-sha256", "crypto", "camelcase-keys",
"xstate/lib/actions", "style-dictionary/lib/utils/deepExtend", "style-dictionary/lib/utils/flattenProperties",
"style-dictionary/lib/utils/references/usesReference",
]
}
}
@gsans

gsans commented Oct 13, 2021

Copy link
Copy Markdown
Author

Got it. Thanks!

@msalti

msalti commented Mar 22, 2023

Copy link
Copy Markdown

thanks @gsans ! Also had to add the following (on amplify version 11.0.2)

         "xstate/lib/actions",
          "style-dictionary/lib/utils/deepExtend",
          "style-dictionary/lib/utils/flattenProperties",
          "style-dictionary/lib/utils/references/usesReference"

@gsans

gsans commented Mar 22, 2023

Copy link
Copy Markdown
Author

Got it. Thanks!

@msalti

msalti commented Apr 8, 2023

Copy link
Copy Markdown

A few more..

"events",
"xstate/lib/waitFor.js",
"style-dictionary/lib/utils/deepExtend.js",
"style-dictionary/lib/utils/flattenProperties.js",
"style-dictionary/lib/utils/references/usesReference.js",
"cookie"

@gsans

gsans commented Apr 11, 2023

Copy link
Copy Markdown
Author

Thanks! Updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment