slackhq / csp-html-webpack-plugin

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

Consider adding documentation for automatic webpack server restart #76

Closed maudnals closed 3 years ago

maudnals commented 3 years ago

Description

Hi, thank you for this great plugin!! When tweaking my CSP in webpack.config.js, I found myself stopping and restarting my webpack server for my CSP changes to be taken into account. I ended up using nodemon to do this automatically and save time. I think this may be a common workflow, since setting up CSP involves tweaking and back-and-forth. Do you think it would make sense for the README to include a note on how to set this up?

This is what I did:

What type of issue is this? (place an x in one of the [ ])

Requirements (place an x in each of the [ ])

AnujRNair commented 3 years ago

Thanks for the feedback!

I think it's common to expect to have to restart webpack-dev-server each time you change a configuration option, or recompile assets if you're writing to disk.

Although this would make the dev flow easier, it's not something which is specific to this plugin alone - all changes to webpack usually require a restart!

For this reason, I don't think we should add this to the readme, although we do have a paper trail here in this issue for anyone who is interested in hot reloading their csp changes :)