File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 33process . env . BABEL_ENV = 'production' ;
44process . env . NODE_ENV = 'production' ;
55
6+
7+ const babelIE11 = require ( './patch/babelIE11' ) ;
8+ const babelConfig = require ( 'babel-preset-react-app' ) ;
9+
10+ babelIE11 ( babelConfig ) ;
11+
612const webpackPreact = require ( './patch/webpackPreact' ) ;
713const webpackConfig = require ( 'react-scripts/config/webpack.config.prod' ) ;
814webpackPreact ( webpackConfig ) ;
Original file line number Diff line number Diff line change 1+ // Hack babel to build for IE11 instead of IE9
2+ module . exports = babelConfig => {
3+ const presets = babelConfig . presets ;
4+ presets . forEach ( ( preset , i ) => {
5+ if ( ! Array . isArray ( preset ) ) {
6+ return ;
7+ }
8+ preset . forEach ( ( p , j ) => {
9+ if ( p . targets && p . targets . ie ) {
10+ presets [ i ] [ j ] . ie = 11 ;
11+ }
12+ } ) ;
13+ } ) ;
14+ } ;
Original file line number Diff line number Diff line change @@ -7,4 +7,8 @@ const webpackPreact = require('./patch/webpackPreact');
77const webpackConfig = require ( 'react-scripts/config/webpack.config.dev' ) ;
88webpackPreact ( webpackConfig ) ;
99
10+ const babelIE11 = require ( './patch/babelIE11' ) ;
11+ const babelConfig = require ( 'babel-preset-react-app' ) ;
12+ babelIE11 ( babelConfig ) ;
13+
1014require ( 'react-scripts/scripts/start' ) ;
You can’t perform that action at this time.
0 commit comments