@@ -101,6 +101,7 @@ const addTemplate = (appPath, appName, templateOptions) => {
101101 const templateSourcePath = path . join ( __dirname , '..' , 'templates' , 'react' , 'application' ) ;
102102 const packagePath = path . join ( appPath , 'package.json' ) ;
103103 const manifestPath = path . join ( appPath , 'public' , 'manifest.json' ) ;
104+ const indexPath = path . join ( appPath , 'src' , 'index.js' ) ;
104105 const styles = [
105106 'devextreme/dist/css/dx.common.css' ,
106107 './themes/generated/theme.additional.css' ,
@@ -112,6 +113,7 @@ const addTemplate = (appPath, appName, templateOptions) => {
112113 }
113114 preparePackageJsonForTemplate ( packagePath , appName ) ;
114115 updateJsonPropName ( manifestPath , appName ) ;
116+ addPolyfills ( packagePath , indexPath ) ;
115117 install ( { } , appPath , styles ) ;
116118} ;
117119
@@ -124,6 +126,15 @@ const install = (options, appPath, styles) => {
124126 runCommand ( 'npm' , [ 'install' ] , { cwd : appPath } ) ;
125127} ;
126128
129+ const addPolyfills = ( packagePath , indexPath ) => {
130+ const packages = [
131+ { name : 'react-app-polyfill' , version : '^1.0.0' }
132+ ] ;
133+
134+ packageJsonUtils . addDependencies ( packagePath , packages ) ;
135+ moduleUtils . insertImport ( indexPath , './polyfills' ) ;
136+ } ;
137+
127138const addStylesToApp = ( filePath , styles ) => {
128139 styles . forEach ( style => {
129140 moduleUtils . insertImport ( filePath , style ) ;
0 commit comments