skip to Main Content

I’m using this configuration pattern:

new CopyWebpackPlugin({
    patterns: [{
        from: `src/assets/static/**/*`,
        to: 'dist',
    }]
})

But this results to

  • from -> src/assets/static/images
  • to-> dist/src/assets/static/images

Expected Output:

  • from -> src/assets/static/images
  • to-> dist/assets/static/images

Can anyone point out what am I doing wrong?

2

Answers


  1. Have you tried this?

    new CopyWebpackPlugin({
        patterns: [{
            context: './src/assets/static/images',
            from: './**/*',
            to: './assets/static/images',
        }]
    });
    

    Eventually you can try with to: './dist/assets/static/images'

    Login or Signup to reply.
  2. Why don’t you adjust the to configuration slightly.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search