Copy dist/ during buid:production process

I’m using copy-webpack-plugin to copy build folders and send them to prod folder like that:

if (config.env.production) {
    new CopyPlugin([
      { from: config.paths.root+'/app', to:'/app' },
      { from: config.paths.root+'/config', to:'/config' },
      { from: config.paths.root+'/resources', to:'/resources' },
      { from: config.paths.root+'/vendor', to:'/vendor' },
      //{ from: config.paths.root+'/dist', to:'/dist' },

The only problem is with dist/ folder. Webpack return this warning:

WARNING - unable to locate ‘M:\website\wp-content\themes\theme/dist’ at ‘M:\website\wp-content\themes\theme/dist’

Any idea?

I think I found a solution with this plugin:

This topic was automatically closed after 42 days. New replies are no longer allowed.