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