Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding documentation for automatic webpack server restart #76

Closed
4 of 9 tasks
maudnals opened this issue Dec 23, 2020 · 1 comment
Closed
4 of 9 tasks

Comments

@maudnals
Copy link

maudnals commented Dec 23, 2020

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:

  • Created nodemon.json in my project root:
{
  "watch": ["webpack.config.js"],
  "exec": "node scripts/start.js" // = what was in my package.json's start script
}
  • In package.json, added a new script:
 "start:watch:webpack": "nodemon",
  • Used npm run start:watch:webpack when setting up my CSP.

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

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • testing related
  • discussion

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

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.
@AnujRNair
Copy link
Contributor

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants