Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

294
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda