No
I checked "browserlists" query. I read "Supported Browsers and Features", but it is not specified if change to browserslist config will have effect on the build process without need to eject project.
I tried to look for issues and configuration instructions related to browserslist in official create-react-app documentation, as well as on other portals such as stackoverflow. I haven't found any reports that help me solve my problem.
System:
OS: macOS 10.14.2
CPU: x64 Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz
Binaries:
Node: 10.12.0 - /usr/local/bin/node
Yarn: 1.12.3 - ~/.yarn/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Browsers:
Chrome: 71.0.3578.80
Firefox: 63.0
Safari: 12.0.2
npmPackages:
react: ^16.6.3 => 16.6.3
react-dom: ^16.6.3 => 16.6.3
react-scripts: 2.1.1 => 2.1.1
npmGlobalPackages:
create-react-app: 1.4.1
Modern JS such as const, let and arrow functions, etc. should not be transpiled.
After specifying different browser target in browserslist build output does not change. You can still see vars in the output.
This is expected. Browserslist only affects the CSS and produces no change to the JavaScript.
We'll be adding a modern build mode soon!
Thanks for the info. Couldn't find explanation anywhere.
@Timer, is there any tracking issue for configurable preset-env/modern build mode ?
Thanks!
This is expected. Browserslist only affects the CSS and produces no change to the JavaScript.
@jaworek Could you explain why this is the case? Is it making the build process too complicated otherwise (especially with Uglify only supporting ES5, as far as I'm aware)?
@NeoLegends I'm writing an app that is going to be run only on modern Chromium web browsers, so there is no need for me to transpile my code down to ES5.
Also, newest versions of webpack use Terser instead of Uglify, which supports ES6+.
Ah sorry, I pinged the wrong person. I meant to ping @Timer.
Most helpful comment
Thanks for the info. Couldn't find explanation anywhere.