Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
to
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
matrix
to
Commits
5aa2858f
Commit
5aa2858f
authored
4 years ago
by
Bruno Windels
Browse files
Options
Downloads
Patches
Plain Diff
fix need for unsafe-eval in CSP header
parent
034426ed
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/build.js
+4
-0
4 additions, 0 deletions
scripts/build.js
with
4 additions
and
0 deletions
scripts/build.js
+
4
−
0
View file @
5aa2858f
...
@@ -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>`
];
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment