Minimize and Uglify WordPress Plugin Files

The simplest solution is to keep your source in the root of the plugin folder (i.e. your typical WordPress setup listed above). Your build script should write its output to a dist folder at the root of the plugin.

This prevents any possible WordPress conflicts; PHP and WordPress won’t parse a file unless it is referenced with an include, require or otherwise in your code. So my_plugin.php in the root of the plugin and in the dist folder won’t conflict at all.