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

93
Views
Webpack bundling lodash arroja error de sintaxis

Soy un novato en los paquetes de módulos y sigo este video para aprender a usar Webpack: https://www.youtube.com/watch?v=5IG4UmULyoA

Este es mi increíblemente simple archivo package.json:

 { "name": "t1", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "build": "webpack" }, "keywords": [], "author": "", "license": "ISC", "dependencies": { "lodash": "^4.17.21" }, "devDependencies": { "webpack": "^5.69.1", "webpack-cli": "^4.9.2" } }

Instalé lodash e importé su función camelCase como sigue en mi src/index.js:

 import { camelCase } from 'lodash'; console.log(camelCase('hello world'));

Lo construí mediante npm run build y se crea un archivo incluido en dist/main.js, al igual que en el video que vinculé anteriormente.

Incrusté el script dist/main.js incluido en mi index.html y arroja Uncaught SyntaxError: Invalid or unexpected token en main.js línea 2.

Probado en diferentes navegadores: Opera, Chrome y Edge, pero no hay diferencia y dado que el paquete dist/main.js parece muy complicado y minimizado, no puedo entender qué tiene de malo.

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!