Skip to content

Commit

Permalink
feat(FEC-14380): add nonce to style tags
Browse files Browse the repository at this point in the history
  • Loading branch information
lianbenjamin committed Mar 3, 2025
1 parent ca7ad1b commit 61fc264
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"dependencies": {
"@playkit-js/common": "1.5.22",
"@playkit-js/ui-managers": "1.5.2",
"@playkit-js/webpack-common": "^1.0.1-canary.0-dfd24a9",
"sanitize-html": "2.11.0"
},
"devDependencies": {
Expand Down
9 changes: 8 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const webpack = require('webpack');
const path = require('path');
const packageData = require('./package.json');
const {insertStylesWithNonce} = require('@playkit-js/webpack-common');

const plugins = [
new webpack.DefinePlugin({
Expand Down Expand Up @@ -38,7 +39,13 @@ module.exports = {
test: /\.scss$/,
use: [
{
loader: 'style-loader'
loader: 'style-loader',
options: {
attributes: {
id: `${packageData.name}`
},
insert: insertStylesWithNonce
}
},
{
loader: 'css-loader',
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@
dependencies:
"@playkit-js/common" "^1.2.10"

"@playkit-js/webpack-common@^1.0.1-canary.0-dfd24a9":
version "1.0.1-canary.0-dfd24a9"
resolved "https://registry.yarnpkg.com/@playkit-js/webpack-common/-/webpack-common-1.0.1-canary.0-dfd24a9.tgz#e1760b4c10f789c62bfd29a73d873d547b52a25c"
integrity sha512-/dlxA7iKF5/SW9Y282THjFRWW0SjKugg4XZgL6OLdfSvAUKcfNXmtSjiqjDBpcrZP51288DyJhOj2+0Tp+R39A==

"@sindresorhus/is@^0.7.0":
version "0.7.0"
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd"
Expand Down

0 comments on commit 61fc264

Please sign in to comment.