question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GraphQL always gets bundled (webpack)

See original GitHub issue

These are the only imports I have of Amplify, and I’m not using any of the GraphQL features. However, when using Webpack Bundle Analyzer, I see that almost 150kb of my project hundle is the GraphQL module that Amplify imports. I did try to tell Webpack to exclude the module from my build, but then Amplify fails to load because it explicitly imports GraphQL in one of its files (there was no stack trace given). Again, below are the only imports my project uses:

import Auth from '@aws-amplify/auth';
import { Hub, ConsoleLogger } from '@aws-amplify/core';

aws-amplify 1.1.4 aws-amplify-react 2.0.5

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
kadrachcommented, Nov 27, 2018

@aws-amplify/api always required bundling graphql as well. It would be nice if the aws4 signature process for REST endpoints (e.g. Lambda) could be loaded individually.

1reaction
samparnellcommented, May 3, 2019

The root cause is the aws-amplify which will import all the modules. And if you are using aws-amplify-react, you have to import the whole aws-amplify library for now.

Will this be resolve at some point? If you are just using Amplify for Auth in a React app then there is an excessive amount of additional stuff that gets included.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack'ing your GraphQL Documents
Since it is a Webpack loader, it has to turn each .graphql into a bit of Javascript code that Webpack can place into...
Read more >
PersistGraphQL Webpack Plugin with Hot Code Reload ...
PersistGraphQL Webpack Plugin is a tool to gather GraphQL queries from source code of GraphQL projects and inject them into the build bundles....
Read more >
How to build an Apollo GraphQL server with TypeScript and ...
Webpack is a JavaScript module bundler. It is also capable of transforming, bundling, or packaging just about any resource or asset.
Read more >
Nodejs error after webpacking the bundle - Stack Overflow
graphql /schema"; import * as authenticator from ". ... the bundle using webpack and move to production, I'm getting the following error:
Read more >
A Guide to Managing Webpack Dependencies - Toptal
The Webpack module bundler processes JavaScript code and all static ... However, configuring Webpack and its dependencies can be cumbersome and not always...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found