slackhq / csp-html-webpack-plugin

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

Add webpack compilation object to processfn #81

Closed samsaggace closed 3 years ago

samsaggace commented 3 years ago

Summary

Enables to manipulate the webpack build to add an asset file to the build. Discussed in https://github.com/slackhq/csp-html-webpack-plugin/issues/52

Requirements (place an x in each [ ])

CLAassistant commented 3 years ago

CLA assistant check
All committers have signed the CLA.

samsaggace commented 3 years ago

Regarding tests, I added the argument to the list of expected arguments, but not that it's really the webpack compilation object, I don't know if it's possible or needed

codecov[bot] commented 3 years ago

Codecov Report

Merging #81 (f55370b) into master (96491f9) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #81   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines          108       108           
  Branches        19        19           
=========================================
  Hits           108       108           
Impacted Files Coverage Δ
plugin.js 100.00% <100.00%> (ø)

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 96491f9...f55370b. Read the comment docs.

samsaggace commented 3 years ago

Repushed : reinstall webpack-sources dependency with node 10 and npm 6 installed to avoid big diff in package-lock.json

samsaggace commented 3 years ago

Hi @AnujRNair,

I think I have implemented your suggestions but please tell me if there is something else I need to do before this PR could be merged.

Thanks

AnujRNair commented 3 years ago

Once I have had a second to confirm whether a regression was released or not in 5.0.1 as reported in https://github.com/slackhq/csp-html-webpack-plugin/issues/80, I will also release this change to NPM.

Thanks for the contribution!