Skip to content

Commit

Permalink
fix: enable esModuleInterop
Browse files Browse the repository at this point in the history
Resolves #77
  • Loading branch information
dpilch committed Sep 16, 2021
1 parent 5ea1e96 commit 9c8b5a6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,14 @@ export default function BoxWithButton(props) {

exports[`amplify render tests custom render config should render common JS 1`] = `
"\\"use strict\\";
var __importDefault =
(this && this.__importDefault) ||
function (mod) {
return mod && mod.__esModule ? mod : { default: mod };
};
Object.defineProperty(exports, \\"__esModule\\", { value: true });
/* eslint-disable */
const react_1 = require(\\"react\\");
const react_1 = __importDefault(require(\\"react\\"));
const ui_react_1 = require(\\"@aws-amplify/ui-react\\");
function BoxWithButton(props) {
return react_1.default.createElement(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,12 @@ export abstract class ReactStudioTemplateRenderer extends StudioTemplateRenderer
target,
module,
jsx: script === ScriptKind.JS ? ts.JsxEmit.React : ts.JsxEmit.Preserve,
esModuleInterop: true,
},
}).outputText;

console.log(transpiledCode);

return prettier.format(transpiledCode, { parser: 'babel', plugins: [parserBabel] });
}

Expand Down

0 comments on commit 9c8b5a6

Please sign in to comment.