Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

293
Vistas
How to configure webpack for implementing CSP

I currently have a Web Application with Django and React. Started implementing CSP from django and everything going well untill now, added all sources of external scripts. Im currently bumping to this webpack problem: First we weren't using devtools options, and in that way, the code was build using eval(). eg;

/***/ (function(module, exports) {

eval("function _arrayLikeToArray(arr, len) {
  if (len == null || len > arr.length) len = arr.length;\n\n  for (var i = 0, arr2 = new Array(len); i < len; i++) ... 
and evals like that

methods everywhere on the production code. Since CSP doesn't allow to safelly use eval expressions (and I dont want to use unsafe-eval option because damages the security), I saw this github thread to use devtool: source-map for bundling without the eval expressions.

When I rebuild my code, the problem is still occuring. The rebuild code:

"build:dev": "cross-env NODE_ENV=production INDEX_FILE=dev webpack --mode production --progress --colors --config webpack/webpack.config.prod.js"

The devtool config is inside this webpack.config.prod.js file.

What should I do?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda