Answer the question
In order to leave comments, you need to log in
What should be specified in the settings so that the code is compiled not in ES5 but in ES6?
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: 'babel',
query: {
cacheDirectory: true,
plugins: ['transform-runtime', 'transform-decorators-legacy'],
presets: ['es2015', 'react', 'stage-0']
}
}
Answer the question
In order to leave comments, you need to log in
Дак babel как раз нужен чтобы компилировать код только в es5, т.е. вы пишете на es6 -> получаете код работающий везде. По поводу если вы хотите видеть код для отладки тогда используйте source-map. В webpack конфиге укажите:devtool: 'source-map',
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question