P
P
psyhO_octopus2015-07-25 23:22:40
JavaScript
psyhO_octopus, 2015-07-25 23:22:40

How to make friends ie8 and React with ES6?

The essence of the problem is that React, starting from version 0.13, transforms classes written in es6 differently. Here's what it says on their website:

When transforming ES6 syntax, class methods are no longer enumerable by default, which requires Object.defineProperty; if you support browsers such as IE8, you can pass --target es3 to mirror the old behavior

The question is where to specify this target parameter? The project is built using webpack and babel.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2015-07-25
@OneFive

Probably so:

module: {
  loaders: [
    {
      test: /\.jsx?$/,
      exclude: /(node_modules|bower_components)/,
      loader: 'babel?target=es3'
    }
  ]
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question