Create-react-app: Able to view the whole source code in the production build when I run it locally using pushstate-server

Created on 24 Feb 2017  路  2Comments  路  Source: facebook/create-react-app

Able to view the whole source code of the project in the chrome debugger when running the build using pushstate-server. Not sure whether this is a known issue or an expected behavior.

NOTE:

I haven't ejected the project.

Steps to reproduce:

  • Initialize a project with CRA create-react-app testApp
  • Run yarn run build to bundle the project
  • Deploy the build using pushstate-server using pushstate-server build
  • Go to localhost:9000 and go to sources in chrome debugger.

Now go to sources and see the following path top -> webpack:// -> . -> src.

Actual Behavior

Here you can see the whole code of the project in the production build.

Expected Behavior

The source code is not supposed to be exposed in the production build.

Discussion

Can anyone confirm whether this is a bug or just an expected behavior.

The following image shows the code when I deployed the project locally using pushstate-server

screen shot 2017-02-24 at 4 10 35 pm

Most helpful comment

This is expected. You can delete .map files from the build output if you want to disable it, although you'll get console warnings about them missing.

There is no harm in leaving them in though in my opinion. Client code is already available to the user鈥檚 machine so there鈥檚 no secrets in it.

All 2 comments

This is expected. You can delete .map files from the build output if you want to disable it, although you'll get console warnings about them missing.

There is no harm in leaving them in though in my opinion. Client code is already available to the user鈥檚 machine so there鈥檚 no secrets in it.

Just wanted to know, thanks for the clarification @gaearon

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wereHamster picture wereHamster  路  3Comments

fson picture fson  路  3Comments

DaveLindberg picture DaveLindberg  路  3Comments

ap13p picture ap13p  路  3Comments

Aranir picture Aranir  路  3Comments