Control Panel JS plugin for Craft CMS
This version is for Craft 3. To install it, visit the Plugin Store in your site's Control Panel.
For the Craft 2 version, see the
After you've installed the plugin, go to:
- Settings > Plugins > Control Panel JS
Environment-aware file path
/config/cp-js.php file, and enter something like this...
return [ '*' => , 'dev' => [ 'jsFile' => 'http://local.dev/path/to/cp.js', ], 'production' => [ 'jsFile' => 'http://example.com/path/to/cp.js', ] ];
You can also keep the file path out of your repo entirely, by using
.env variables to set the JS file path...
return [ 'jsFile' => getenv('CP_JS_FILE'), ];
With that in place, you can add this to your
# Path to JS file for the Control Panel CP_JS_FILE="http://example.com/path/to/cp.js"
We've got other plugins too!
Check out the full catalog at doublesecretagency.com/plugins