tooltip icon indicating copy to clipboard operation
tooltip copied to clipboard

Published JS requires unsafe-eval

Open jamesarosen opened this issue 10 years ago • 2 comments

The published JS includes lines that look like

require.register("darsain-event/index.js", Function("exports, require, module",
"'use strict';\n\
\n\
/**\n\
...

This is valid JavaScript, but violates a Content Security Policy unless the site allows unsafe-eval (which is strongly recommended against).

Would it be possible to rebuild with non-stringified dependencies?

jamesarosen avatar Jan 28 '16 16:01 jamesarosen

@darsain any chance of an update on this or whether we should look at fixing this ourselves?

adam-knights avatar Mar 17 '16 10:03 adam-knights

The issue here is that the current distribution files are configured to be build with sourcemaps included. That's why its all evaled. It's the easiest way how to get sourcemaps in.

I've described the situation of this and all of my other projects here: https://github.com/darsain/tooltip/issues/28#issuecomment-201911404

As it says in that comment, I never intended these dist files to be used in production. The quickest way for you how to get un-evaled version is to grab the minified distribution file, which doesn't inlude sourcemaps.

darsain avatar Mar 26 '16 18:03 darsain