microsoft / TypeScript-Handbook

Deprecated, please use the TypeScript-Website repo instead
https://github.com/microsoft/TypeScript-Website
Apache License 2.0
4.88k stars 1.13k forks source link

Update React & Webpack.md #1334

Closed cseas closed 3 years ago

cseas commented 3 years ago

Added a note to clarify the use of externals property in webpack config.

I followed this guide as my first webpack tutorial then moved on to webpack docs to learn more and add more things to the webpack config. None of the other tutorials I saw had manually added any React libraries to index.html so I removed those 2 lines and struggled for about a week to realize the externals field added from this tutorial was the reason my site stopped working.

I personally wouldn't recommend adding any externals to a beginner tutorial. Learning webpack is complex enough as it is. Something like externals should only be introduced in a "Production/Deployment" or "Optimizations" related page after a beginner has gone through the initial tutorial without hiccups. But if that has to be included in this beginner tutorial, the purpose of it should be made really clear.

orta commented 3 years ago

Thanks, this page has been replaced with a redirect to the official webpack docs for TypeScript - so people shouldn't get caught up in it in the future