Amplify-js: Exposing my security files

Created on 8 Jun 2019  路  4Comments  路  Source: aws-amplify/amplify-js

* Which Category is your question related to? *
AWS AMPLIFY PUBLISH
* What AWS Services are you utilizing? *
Storage and Authentication
* Provide additional details e.g. code snippets *
I have my react website which I delpoyed to cloudfront using the aws publish -c command.
But I went to my website live in the browser In the source files I can see all the 'aws-export.js' with all my details

So my question Is this fine and expected behaviour?
If somebody sees this can they do anything with it or it is pretty useless?
just worried whether this is a security concern or not for me?
[These files are created automatically while I setup my amplify storage and Auth]

Screen Shot 2019-06-08 at 5 21 59 PM

Most helpful comment

I was looking for the solution to this as well. In your package.json file, add GENERATE_SOURCEMAP=false to the build command and your source code won't show up:

scripts: {
  ...,
  "build": "GENERATE_SOURCEMAP=false react-scripts build"
}

All 4 comments

aws-exports is added to .gitignore

aws-exports is added to .gitignore
I have one more question.... might not be relevant here but if someone knows to answer it helps...

If I don't want my source code visible in the browser if I am deploying using CloudFront Is there any way to do it in CloudFront....
(as amplify already minifying and chunking my files then is there still need for my source files to get uploaded? can I add them to git ignore too? sounds silly but just checking )

I was looking for the solution to this as well. In your package.json file, add GENERATE_SOURCEMAP=false to the build command and your source code won't show up:

scripts: {
  ...,
  "build": "GENERATE_SOURCEMAP=false react-scripts build"
}

I was looking for the solution to this as well. In your package.json file, add GENERATE_SOURCEMAP=false to the build command and your source code won't show up:

scripts: {
  ...,
  "build": "GENERATE_SOURCEMAP=false react-scripts build"
}

Adding aws-exports is added to .gitignore didn't work.

But "build": "GENERATE_SOURCEMAP=false react-scripts build" worked like a charm it solved all the issues no source code file and no config files only chunk files....Thank you very much for your help... (I think aws need to add this comment to their either CloudFront or code deploy document)

Was this page helpful?
0 / 5 - 0 ratings