Hey. It's just interesting if there is any reason for storing the .babelrc file for storing the preset instead of having presets in the webpack.config file (except for the possibility of reusing the babelrc file in another project). I had an application that works correctly using the .babelrc file as follows:
{ "presets": ["es2015", "stage-0","react"] }
Then I moved the application to another webpack structure without a .babelrc file:
//webpack.config.js module: { loaders: [ { test: /(\.js|\.jsx)$/, exclude: /(node_modules)/, loader: 'babel', query: { presets: ['es2015', 'stage-0', 'react'] } },
Strange, now the application stops working with the problem of parsing jsx and "importing" keywords, etc. inside my server.js file. It only works when adding a babelrc file. Can someone explain why it only works with babelrc file?
source share