How to use React without unsafe inline JavaScript/CSS code?

后端 未结 2 527
孤独总比滥情好
孤独总比滥情好 2021-01-01 14:12

Background

I have to use a Content Security Policy for a react application.

The reason, that is however not of a big matter here, is, that I am creating

2条回答
  •  忘掉有多难
    2021-01-01 14:53

    Actually thanks to @heyimalex I found a very easy answer for my problem. Just run the build script like this:

    INLINE_RUNTIME_CHUNK=false npm run build
    

    Afterwards, it should be CSP-compatible.

提交回复
热议问题