title: Text replacement on a copied file with webpack
body: <p>I have a <code>build.config.xml</code> that has a couple of strings in it like <code>$FABRIC_API_KEY</code>. I want to replace this with <code>process.env.FABRIC_API_KEY</code> in a new file <code>config.xml</code> (<code>build.config.xml</code> should remain the same). I have tried using <a href="https://github.com/kevlened/copy-webpack-plugin" rel="noreferrer"><code>CopyWebpackPlugin</code></a>, but I can't seem to get this to do anything.</p>
  
  <pre><code>var CopyWebpackPlugin = require('copy-webpack-plugin');
  
  module.exports = {
    ...    
    resolve: {
      extensions: ['.ts', '.js', '.json', '.xml'],
      ...
  
    plugins: [
      ionicWebpackFactory.getIonicEnvironmentPlugin(),
      new CopyWebpackPlugin([{
        from: 'build.config.xml',
        to: 'config.xml',
        transform: function (content) {
          content = content
            .replace('$FABRIC_API_SECRET', process.env.FABRIC_API_SECRET)
            .replace('$FABRIC_API_KEY', process.env.FABRIC_API_KEY);
  
          return content;
        },
      }]),
    ],
  };
  </code></pre>
  
  <p>The file does other things (builds ionic) and everything else works as expected. There are no errors or anything, and <code>config.xml</code> does not get created.</p>
  
  <p>What can I do to copy a file and replace strings in it? I am open to using another plugin.</p>