aws-mobile-appsync-sdk-js icon indicating copy to clipboard operation
aws-mobile-appsync-sdk-js copied to clipboard

Compiled Module uses both require and import

Open vonKristoff opened this issue 5 years ago • 2 comments

Look at aws-appsync/lib/index it wraps require calls as ES6 modules.

"use strict";
function __export(m) {
    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var client_1 = require("./client");
__export(require("./client"));

IF you use Webpack then that is fine, as it can deal with that. I however use Rollup, and it can only transpile one or the other. Its not exactly embracing the inclusive nature of the web forcing a webpack only module.

Is it not possible to even use this or create a build that strictly keeps the transpiled code to ES5 / ES6 so that it works as a standalone browser module ? I had a look at creating a custom build using tsconfig.json from this repo, but wasn't successful.

Would it possible to bypass aws-mobile-appsync-sdk-js and connect to an Amazon Dynamo GraphQL endpoint using just the Apollo Client? #

vonKristoff avatar Sep 21 '18 08:09 vonKristoff

@vonKristoff thanks for your feedback. We will investigate on this issue

elorzafe avatar Sep 27 '18 18:09 elorzafe

@elorzafe - what is the status of this? Is it just not possible to use this library with Rollup?

RobM-ADP avatar Jul 01 '22 14:07 RobM-ADP