Open praveen7557 opened 1 year ago
i'm also having trouble getting this working with my setup.
coverageGlobalScopeFunc: false, coverageGlobalScope: 'window'
setting these options fixes the CSP error, but causes another babel plugin (vanilla-extract) to fail with this error: ReferenceError: window is not defined.
babel-plugin-istanbul seems to be adding instrumentation to my vanilla extract css.ts files. when i exclude
these files in the istanbul options, it avoids most of the files, but not all for some reason. this is my setup:
babel: {
plugins: [
[
'istanbul',
{
coverageGlobalScopeFunc: false,
coverageGlobalScope: 'window',
'report-dir': 'coverage',
all: true,
useInlineSourceMaps: false,
extends: '@istanbuljs/nyc-config-typescript',
include: ['src/**/*.tsx', 'src/**/*.ts'],
exclude: [
'src/**/*.css',
'src/**/*.css.ts',
'src/**/*.test.ts',
'src/**/*.test.tsx',
'src/**/*.spec.ts',
'src/**/*.spec.tsx',
'src/**/graphql/**/*',
'src/**/*.d.ts',
],
},
],
],
},
I am getting the error
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' 'wasm-unsafe-eval'"
while addingbabel-plugin-istanbul
to a chrome extension which uses manifest v3 which doesn't alloweval
function.But, the package adds
var global = new Function("return this")()
to thebackground.js
file. Is there any way to solve this?