'Exclude coverage directory in React JS build
When I build my React JS application by running the react-scripts build script in package.json, I see that the build directory contains two sub-directories - coverage and static. As I have analyzed, the directory 'coverage' is created by Jest to show the unit test coverage. The problem is that each file in this directory has the following inline tags :
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
The Content Security Policy configured in the production environment disallows the inline tags and the user gets a message saying the JavaScript must be enabled. Is there any way to either restrict the build script not to generate the 'coverage' directory at all or delete the 'coverage' directory from the build?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
