yarn build and the project contains the entire source code
See original GitHub issueI came across this accidently. In the past I was used to have an obfuscated version of my SPA after “npm run build”.
With the latest react-static (which does not work correctly with npm run build
, but it passes with yarn build
, see here https://github.com/nozzle/react-static/issues/1053) there is the full source code available in user’s browser. In the beginning I thought, this is just because there is somewhere a file link to the source code in a map or so and it would be only visible to me, but after deploying it to a webserver it was also available to all.
Steps to reproduce:
- react-static create
- use “blank” target
- To visualize the issue add a
console.log("Hello World")
in App.js, but you could also browse the source tree in developer console
render () {
console.log("Hello World")
return (
- run
yarn build
- run `yarn serve``
- open
localhost:3000
in your browser - open developer console
- find
Hello World
and click the right most link to ‘App.js:9’
Find your sources. Bummer
I never had this with previous react-static versions.
Issue Analytics
- State:
- Created 5 years ago
- Comments:46 (46 by maintainers)
Top Results From Across the Web
Creating a Package - Yarn
A package is a directory with some code and a package.json file that provides information to Yarn about your package. Most packages use...
Read more >Why does bundle include source files and other non-runtime ...
The yarn build -c option, is really a way for you to leverage the dependency graph to run a script in parallel, such...
Read more >Always commit your yarn.lock file into the source code repo
I use the Yarn package manager for all my Angular projects. Besides being faster than npm, yarn creates a file yarn.lock that stores...
Read more >What does " yarn build " command do? Are " npm build " and ...
after yarn build you can see the build folder inside your project, this folder contains the bundled app or compiled project. – noe....
Read more >Yarn Workspaces: Organize Your Project's Codebase Like A Pro
React is a good example of an open-source project that is monorepo. ... To fully complete this tutorial, you will need to have...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We’ll have a config option for this
sourceMaps: true
and possibly some other options. This option will likely default tofalse
, given that most people don’t need source maps in production.Yes, you could easily just not upload them, but I think that would provide more trouble for people who repeatedly have to remove them or exclude them from the build directory, etc. While that’s still possible, I think the flag will be more intuitive for both use cases.
Right, feel free to close. I’m having my solutions