Skip to content

Commit 04a5c34

Browse files
sag1vTimer
authored andcommitted
Update minify instructions (facebook#5105)
* changed to Migrate to v2.x * richer explanation * Update README.md
1 parent 7e0b501 commit 04a5c34

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

template/README.md

+2-13
Original file line numberDiff line numberDiff line change
@@ -2406,20 +2406,9 @@ This will only work for locales that have been explicitly imported before.
24062406
24072407
### `npm run build` fails to minify
24082408
2409-
Some third-party packages don't compile their code to ES5 before publishing to npm. This often causes problems in the ecosystem because neither browsers (except for most modern versions) nor some tools currently support all ES6 features. We recommend to publish code on npm as ES5 at least for a few more years.
2409+
Starting in Create React App v2, we now compile all ES.Next features found in `node_modules`. This means you can consume packages and not worry about them being syntax-incompatible with any browser.
24102410
2411-
<br>
2412-
To resolve this:
2413-
2414-
1. Open an issue on the dependency's issue tracker and ask that the package be published pre-compiled.
2415-
2416-
- Note: Create React App can consume both CommonJS and ES modules. For Node.js compatibility, it is recommended that the main entry point is CommonJS. However, they can optionally provide an ES module entry point with the `module` field in `package.json`. Note that **even if a library provides an ES Modules version, it should still precompile other ES6 features to ES5 if it intends to support older browsers**.
2417-
2418-
2. Fork the package and publish a corrected version yourself.
2419-
2420-
3. If the dependency is small enough, copy it to your `src/` folder and treat it as application code.
2421-
2422-
In the future, we might start automatically compiling incompatible third-party modules, but it is not currently supported. This approach would also slow down the production builds.
2411+
If you're seeing this error, you're likely using an old version of `react-scripts` and need to upgrade to `react-scripts@>=2.0.0`.
24232412
24242413
## Alternatives to Ejecting
24252414

0 commit comments

Comments
 (0)