Skip to content
Snippets Groups Projects
Commit 5aa2858f authored by Bruno Windels's avatar Bruno Windels
Browse files

fix need for unsafe-eval in CSP header

parent 034426ed
No related branches found
No related tags found
No related merge requests found
...@@ -69,6 +69,10 @@ async function buildHtml(assets) { ...@@ -69,6 +69,10 @@ async function buildHtml(assets) {
const doc = cheerio.load(devHtml); const doc = cheerio.load(devHtml);
doc("link[rel=stylesheet]").attr("href", assets.resolve(`bundle.css`)); doc("link[rel=stylesheet]").attr("href", assets.resolve(`bundle.css`));
const mainScripts = [ const mainScripts = [
// this is needed to avoid hitting https://github.com/facebook/regenerator/issues/378
// which prevents the whole bundle to load, as our CSP headers don't allow unsafe-eval
// and I preferred this over disabling strict mode for the whole bundle
`<script type="text/javascript">window.regeneratorRuntime = undefined;</script>`,
`<script type="text/javascript" src="${assets.resolve(`bundle.js`)}"></script>`, `<script type="text/javascript" src="${assets.resolve(`bundle.js`)}"></script>`,
`<script type="text/javascript">bundle.main(document.body);</script>` `<script type="text/javascript">bundle.main(document.body);</script>`
]; ];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment