lxieyang / chrome-extension-boilerplate-react

A Chrome Extensions boilerplate using React 18 and Webpack 5.
MIT License
3.42k stars 1.07k forks source link

Add configuration to enable react-devtools? #179

Open zeroarst opened 1 year ago

zeroarst commented 1 year ago

Looks like the only way to make it works is to install standalone react-devtools, and then add the script to head of the index.html file. <script src="http://localhost:8097"></script>

And add the policy to manifest.json.

"content_security_policy": {
  "extension_pages": "script-src 'self' http://localhost:*;"
}

refer to https://developer.chrome.com/docs/extensions/migrating/improve-security/#remove-unsupported-csv

Instead of manually adding it and have to remember to remove it in production, is there any way to configure that in webpack? I am pretty new to webpack..