$ npm install copy-webpack-plugin --save-dev

 

const CopyPlugin = require('copy-webpack-plugin');
 
module.exports = {
  plugins: [
    new CopyPlugin([
      { from: 'source', to: 'dest' },
      { from: 'other', to: 'public' },
    ]),
  ],
};
或者
module.exports = {
  plugins: [
    new CopyPlugin([{ from: 'public'}])
    ],
};


module.exports = {
  plugins: [new CopyPlugin(patterns, options)],
};