babel-loader

babel-preset-env SyntaxError: Unexpected token with spread properties

谁说我不能喝 提交于 2019-11-30 05:02:57
问题 Why its not accepting spread properties ? I am using babel-preset-env for this. .babelrc { "presets": [ "react", [ "env", { "targets": {}, "debug": true, "modules": "commonjs" } ] ] } package.json { "name": "myapp", "version": "0.1.0", "main": "index.js", "private": true, "dependencies": { "babel-core": "6.25.0", "babel-loader": "7.1.1", "babel-preset-env": "^1.6.0", "babel-preset-react": "^6.24.1", "extract-text-webpack-plugin": "3.0.0", "file-loader": "0.11.2", "html-webpack-plugin": "^2.30

babel vs babel-core vs babel-loader vs babel-preset-2015 vs babel-preset-react vs babel-polyfill

徘徊边缘 提交于 2019-11-29 23:36:27
I was setting up Webpack for my React project and got confused between babel , babel-core , babel-loader , babel-preset-2015 and babel-preset-react . I know that Babel is needed to transform ES7 or ES6 code to ES5 but in my package.json I have installed all these dependencies except Babel and they also as devDependencies . Can someone please explain what's the difference between all these and why all of them are needed for my project? Isn't there any single dependency to replace them all? And if they are so important, why are they included as devDependencies ? babel Babel doesn't do anything

Whats the difference when configuring webpack babel-loader vs configuring it within package.json?

馋奶兔 提交于 2019-11-29 10:54:46
Hi please help me understand the differences between setting babel config inside .babelrc vs webpack loader options, vs inserting it in package.json. For example, Would it make any difference if I put the presets in the webpack babel-loader options vs package.json or a separate .babelrc config file? In webpack config: { test: /\.(js|jsx|mjs)$/, loader: require.resolve('babel-loader'), options: { "presets": [ "react-app" ] }, }, In package json: "babel": { "presets": [ "react-app" ] }, Webpack config : config the babel-loader completely in webpack.conf.js (no .babelrc). Webpack config +

babel vs babel-core vs babel-loader vs babel-preset-2015 vs babel-preset-react vs babel-polyfill

被刻印的时光 ゝ 提交于 2019-11-28 17:25:43
问题 I was setting up Webpack for my React project and got confused between babel , babel-core , babel-loader , babel-preset-2015 and babel-preset-react . I know that Babel is needed to transform ES7 or ES6 code to ES5 but in my package.json I have installed all these dependencies except Babel and they also as devDependencies . Can someone please explain what's the difference between all these and why all of them are needed for my project? Isn't there any single dependency to replace them all? And