0

Node/Javascrip babel configuration

If i am using webpack loader : babel-loader, do i still need to have file .babelrc? Is this file still necessary? Why? Ps:.babelrc is used only for transpile es6 to es5

31st Mar 2019, 1:31 PM
Marius
Marius - avatar
3 Respuestas
+ 4
According to Usage part of your link use: { loader: 'babel-loader', options: { presets: ['@babel/preset-env'] } } is inside webpack configuration object. So you don't need .babelrc if you are using webpack babel-loader.
31st Mar 2019, 2:06 PM
Gordon
Gordon - avatar
+ 3
https://babeljs.io/setup#installation From Babel's documentation, you'll need the .babelrc configuration file. What's webpack loader? <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script> This one?
31st Mar 2019, 1:55 PM
Gordon
Gordon - avatar
0
https://webpack.js.org/loaders/babel-loader/ this is what i mean with webpack loader
31st Mar 2019, 1:59 PM
Marius
Marius - avatar