Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

262
Views
When using babel-loader with webpack, does babel-loader transpile code differently than when using Babel directly?

Are the defaults the same? Do they have different targets? Is babel-loader contingent on webpacks targets?

Reason I ask is I am using babel-loader with webpack and when running in production mode, the code is being transpired correctly, expect the const keyword, that word is not being changed to 'var'. However when transpiling with babel directly on the file using babel and not babel-loader through webpack, the output obviously is changing the const keyword to var.

The only time it transpiles const to var, is when I set the webpack.config.js file to have target: ["web", "es5"] however, I feel that should not matter, since babel-loader is just loading the transpiled code from the babel runtime...right? Which contains the var keyword. Or is it not?

What is babel-loader doing different than when running babel on the file directly?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!