How-to guide: Copying files using Webpack plugins

Sometimes in the world of web development you have to work around some funny deployment issues and do things a bit manually.

An issue I recently encountered was trying to copy a single file into the build folder when using webpack to build and run the non-local environment.

After a quick Google (every developers first port of call) I found CopyWebpackPlugin which allows you to copy a single file into the build directory rather than bundling it.

Using this code snippet I was able to copy everything from the kendo folder into the build directory, as well as the Material folder into a sub folder, also called Material.

However this was not the end of the process, as the Kendo files needed to be included in the template.html as scripts and stylesheets. The tags could not be added manually as the files sat in different places for the build and local development running of the app.