slackhq / csp-html-webpack-plugin

A plugin which, when combined with HTMLWebpackPlugin, adds CSP tags to the HTML output.
MIT License
164 stars 39 forks source link

Allow different policies on individual HtmlWebpackPlugin instances #26

Closed AnujRNair closed 5 years ago

AnujRNair commented 5 years ago

Summary

This PR adds functionality to allow the dev to specify individual CSPs on different HtmlWebpackPlugin instances. Full details on how to do so have been added to the readme.

Note: This change introduces a breaking change into the plugin, changing disableCspPlugin to cspPlugin.enabled - because of this, we will need a major version bump when this is published

Requirements (place an x in each [ ])

codecov[bot] commented 5 years ago

Codecov Report

Merging #26 into master-v3 will decrease coverage by 5.75%. The diff coverage is 94.59%.

Impacted file tree graph

@@              Coverage Diff              @@
##           master-v3      #26      +/-   ##
=============================================
- Coverage      97.32%   91.56%   -5.76%     
=============================================
  Files              2        2              
  Lines            187       83     -104     
  Branches          14       11       -3     
=============================================
- Hits             182       76     -106     
- Misses             5        6       +1     
- Partials           0        1       +1
Impacted Files Coverage Δ
test-utils/webpack-helpers.js 100% <100%> (ø)
plugin.js 88.7% <87.5%> (-4.35%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 77da922...94473fd. Read the comment docs.

codecov[bot] commented 5 years ago

Codecov Report

Merging #26 into master-v3 will decrease coverage by 3.81%. The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##           master-v3     #26      +/-   ##
============================================
- Coverage      97.32%   93.5%   -3.82%     
============================================
  Files              2       2              
  Lines            187      77     -110     
  Branches          14      11       -3     
============================================
- Hits             182      72     -110     
+ Misses             5       4       -1     
- Partials           0       1       +1
Impacted Files Coverage Δ
plugin.js 91.07% <100%> (-1.99%) :arrow_down:
test-utils/webpack-helpers.js 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 77da922...94473fd. Read the comment docs.