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

133
Views
Webpack no minimiza CSS y JS en una sola línea y muestra comentarios

Estoy ejecutando el comando npm run build y espero que minimice mis archivos jss y css , pero el código aún se distribuye en varias líneas e incluye comentarios. ¿Cómo decirle a webpack que lo comprima en una sola línea y elimine los comentarios?

así es como se ve el comando de compilación en package.json

 "build": "npm run buildsprite && webpack --config ./webpack/webpack.config.prod.js --colors",

este es un fragmento de optimización de webpack.config.prod.js

 optimization: { minimizer: [ new TerserPlugin({ test: /\.js(\?.*)?$/i, cache: true, parallel: true, sourceMap: true, extractComments: false, }), ], },
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Según la Documentación , su webpack.config.prod.js debería verse así:

 optimization: { minimize: true, minimizer: [ new TerserPlugin({ test: /\.js(\?.*)?$/i, cache: true, parallel: true, sourceMap: true, extractComments: false, }), ], },

Necesita minimize: true para que el paquete web realmente pueda Minificar usando Terser

about 4 years ago · Santiago Trujillo Report
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!