I tried outputting the Webpack generated file directly into the plugin/amd/build directory. This works when the site is in production mode, but it makes development a pain. Since the module is not present in the amd/src file, it doesn't get loaded in development mode which means my only option would be to leave the cache on and manually purge it each time I update the file. I could try putting the webpack-generated file in both places, but I don't want the build version to be overwritten if another developer runs the global Grunt task.
Does anyone know of a self-contained way that I can put my Webpack-compiled file into both /amd/src and /amd/build and have Moodle's grunt process ignore it? I'm hoping to avoid changing the Moodle-level Gruntfile so that my plugin can be installed without modifying existing files.
Alternatively, is there a way that I can force Moodle to look in the /amd/build folder for this particular file even when I'm in development mode? Then I could skip placing it in the /src folder all together and Grunt won't even be aware it exists.