File tree 3 files changed +24
-0
lines changed
3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 3
3
process . env . BABEL_ENV = 'production' ;
4
4
process . env . NODE_ENV = 'production' ;
5
5
6
+
7
+ const babelIE11 = require ( './patch/babelIE11' ) ;
8
+ const babelConfig = require ( 'babel-preset-react-app' ) ;
9
+
10
+ babelIE11 ( babelConfig ) ;
11
+
6
12
const webpackPreact = require ( './patch/webpackPreact' ) ;
7
13
const webpackConfig = require ( 'react-scripts/config/webpack.config.prod' ) ;
8
14
webpackPreact ( 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');
7
7
const webpackConfig = require ( 'react-scripts/config/webpack.config.dev' ) ;
8
8
webpackPreact ( webpackConfig ) ;
9
9
10
+ const babelIE11 = require ( './patch/babelIE11' ) ;
11
+ const babelConfig = require ( 'babel-preset-react-app' ) ;
12
+ babelIE11 ( babelConfig ) ;
13
+
10
14
require ( 'react-scripts/scripts/start' ) ;
You can’t perform that action at this time.
0 commit comments