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

292
Views
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
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!