diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index fa8e53ef..71aae88d 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -10,8 +10,7 @@ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details // about supported directives. -// Need to be on top to allow Poltergeist test to work with React. -//= require es5-shim/es5-shim +// Need to be on top to allow Poltergeist test to work with React: es5-shim/es5-shim. This is lincluded in app-bundle. //= require react_on_rails // It is important that generated/vendor-bundle must be before bootstrap since it is exposing jQuery and jQuery-ujs diff --git a/client/webpack.client.rails.config.js b/client/webpack.client.rails.config.js index 96db2643..a7d4b170 100644 --- a/client/webpack.client.rails.config.js +++ b/client/webpack.client.rails.config.js @@ -24,7 +24,8 @@ config.entry.app.push('./app/startup/clientGlobals'); // See webpack.common.config for adding modules common to both the webpack dev server and rails config.module.loaders.push( - {test: /\.jsx?$/, loader: 'babel-loader', exclude: /node_modules/} + {test: /\.jsx?$/, loader: 'babel-loader', exclude: /node_modules/}, + {test: require.resolve('react'), loader: 'imports?shim=es5-shim/es5-shim&sham=es5-shim/es5-sham'} ); module.exports = config;