Customize webpack config to copy static files to dist

I have some static files that live under src/api/services. They are not JavaScript files and they are not intended to be shown to the public. How do I ensure they end up in dist?

This does not seem to work:

    config.plugins = [
        ...config.plugins,
        new CopyPlugin({
            patterns: [
                {
                    from: path.join(__dirname, "..", "api/generator/services/templates/*.*"),
                    to: path.join(__dirname, "..", "..", "dist/src/api/generator/services/templates")
                },
            ],
            options: {

            }
        }),
    ]