Questions tagged [babel-preset-env]

73 questions
1
vote
1 answer

Exclude arrow functions from transpiling

I'm trying to stop Babel from transpiling arrow functions using .babelrc: { "presets": [ [ "env", { "exclude": [ "transform-regenerator", "transform-async-to-generator", …
user3599803
  • 6,435
  • 17
  • 69
  • 130
1
vote
1 answer

Babel-register working in the package but not when require-ing the package

I've set up babel-register in my package (installed "babel-preset-env": "1.7.0", "babel-register": "6.26.0") index.js require('babel-register'); // Contains a bunch of `import * ` stuff. const lib = require('./lib.js'); .babelrc { …
Alex
  • 10,869
  • 28
  • 93
  • 165
1
vote
1 answer

Does the babel-preset-env pollute the global scope like babel-polyfill does?

I need to use ES6 code and also Object.entries in my code. After looking into babel I saw that they recommended to use babel-preset-env. But I am writing step definitions in webdriverIO and they recommend to use babel-plugin-transform-runtime so…
0
votes
0 answers

the React project execute the eject command, after execution, I found that all the first lines of the JavaScript file will report error

I use the latest create repeat app to create the React project, and then execute the eject command to expose the webpack configuration. However, after execution, I found that all the first lines of the JavaScript file will report errors, and eslint…
Tmier
  • 1
  • 1
0
votes
0 answers

JS file not generating in the same order after Webpack 4 Upgrade

I am in the process of upgrading my site from Webpack 3 to Webpack 4. I'm noticing with the new Webpack 4 configuration, the JavaScript file compiles without errors, but an interactive map on the homepage doesn't generate correctly. Therefore,…
0
votes
0 answers

webpack with css modules enabled generating different classname than visible in dom

I am still new to webpack and babel so pardon me if make some mistake. I am upgrading a project to webpack v5 and babel to latest. I followed the official docs and was able to generate the build successfully without any errors or warnings and the…
0
votes
0 answers

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set

Stack: React 17 Webpack 5 Babel 7 core-js 3 I want to fix the lighthouse error ci: Avoid serving legacy JavaScript to modern browsers When i add debug property debug: true to babel/preset-env of my babel config and I build the application, i have…
0
votes
0 answers

Build failing with browserslist query as cover 66% in Create react app

"production-legacy": [ ">1%", "last 4 versions", "Firefox ESR", "not IE < 9", "not ie_mob < 9" ], "production-modern": [ "cover 66%" ], "development": [ ">1%", "last 4 versions", …
0
votes
1 answer

Why is my nullish-coalascing operators not transpiled by the rollup plugin for babel?

I have a svelte project that I would like to transpile nullish-coalascing operators (es2020) to es5 using the rollup plugin @rollup/plugin-babel which is enabled by default in @babel/preset-env since babel v7.6.3. However in my project it does not…
cascading-jox
  • 982
  • 1
  • 7
  • 21
0
votes
1 answer

Getting Support for the experimental syntax 'jsx' isn't currently enabled in my index file even after adding babel and adding it to packages

I've created a react application, in that I added router-dom, then I made the changes according to the document provided by router-router-dom, but then i ended up getting index.js: Support for the experimental syntax 'jsx' isn't currently…
Venky
  • 1,929
  • 3
  • 21
  • 36
0
votes
1 answer

Using defaults in .browserslistrc with @babel/preset-env

I was reviewing Babel's docs for @babel/preset-env, and noticed this note: Please note that if you are relying on browserslist's defaults query (either explicitly or by having no browserslist config), you will want to check out the No targets…
Tom T
  • 314
  • 2
  • 12
0
votes
1 answer

My webpack babel loader is not compiling my javascript code

I have been learning webpack and babel... All things are working fine but my webpack config is not working as it should, I think something I missed here. Here are my webpack.config.js code const path = require('path'); module.export = { …
Jabid Hasan
  • 19
  • 1
  • 7
0
votes
1 answer

Async await doesn't get compiled in Grunt

I am trying to compile my ES6+ code to vanilla js using Grunt task runner. I have purposely chosen Grunt over webpack and gulp because I just wanted to minify my js files. I have successfully compiled my ES6 code to vanilla after running the code…
Siddhant
  • 196
  • 2
  • 9
0
votes
1 answer

Babel with preset-env (no options) and preset-typescript says "Missing class properties transform". Why?

I've got a fairly simple Babel config: { presets: [ [ '@babel/preset-typescript', { isTSX: true, allExtensions: true, …
trusktr
  • 44,284
  • 53
  • 191
  • 263
0
votes
0 answers

Webpack/Babel: ES6 keywords "async/await" unconverted in transpiled bundle.js

I'm using webpack and babel to transpile my ES6 javascript and React project to a bundle.js. I'm getting this error: bundle.js:90058: ERROR - Parse error. Semi-colon expected: return async function (dispatch) { Why is the "async" keyword still…
jaxreiff
  • 503
  • 1
  • 4
  • 14