Now I'm trying to import aws-exports.js which amplify-js automatically generates in node es6 type code.
my code like this. ex:something.mjs
#!/usr/bin/env node
import awsmobile from '../src/aws-exports.js';
something ....
and I try to execute under bellow
# ./something.mjs
export default awsmobile;
^^^^^^
SyntaxError: Unexpected token 'export'
then, the above error will be output.
I wonder, the aws-exports.js generated by amplify-js is in es6 format, but the extension is js.
Is this the only way to execute it by writing "module" as the "type" field of package.json?
question from:
https://stackoverflow.com/questions/66046539/can-i-have-any-way-to-import-module-about-aws-export-js 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…