When bundling web app using webpack, i need to register some 3rd party scripts into global(i.e. window
) namespace, script-loader seems designed for this Webpack - How to load non module scripts into global scope | window.
However, there is a big downside of it, the generated code uses eval.call
which is not compliant with most CSP security guidelines and thus strongly discouraged to use it in production. Is there any alternative webpack loader that i can use to achieve the same purpose without XSS vulnerabilities?
Also the GitHub project https://github.com/webpack-contrib/script-loader is already archived