我正在将aurelia应用程序部署到生产环境中,但是我遇到了这样的问题,即结果代码包含eval函数调用,但不幸的是,我的生产环境不允许这样做。
我在应用运行时遇到此错误:
vendors~2a42e354.02107019925d746ff1ac.chunk.js:10 Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'".
at Object.GAND (vendors~2a42e354.02107019925d746ff1ac.chunk.js:10)
at __webpack_require__ (runtime~app.02107019925d746ff1ac.bundle.js:85)
at Object.0 (app~01e7b97c.02107019925d746ff1ac.chunk.js:44)
at __webpack_require__ (runtime~app.02107019925d746ff1ac.bundle.js:85)
at checkDeferredmodules (runtime~app.02107019925d746ff1ac.bundle.js:46)
at Array.webpackJsonpCallback [as push] (runtime~app.02107019925d746ff1ac.bundle.js:33)
at app~5a11b65b.02107019925d746ff1ac.chunk.js:1
现在我想知道是否可以通过排除eval函数来构建用于生产的aurelia?
更新
我想这可能与webpack有关。如果是,是否有办法在webpack中更改此配置?