R
R
rusglov2018-07-14 22:58:41
webpack
rusglov, 2018-07-14 22:58:41

How to transfer images to webpack?

Hello, tell me if there is a plugin for webpack that would simply compress and transfer all images to dist, even if they are not connected anywhere.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita Egorov, 2018-07-15
@rusglov

I'll change my answer since I came across a great plugin like - copy-webpack-plugin .
Here is an example configuration:

plugins: [
    new CopyWebpackPlugin([{
            from: './src/fonts',
            to: './fonts'
        },
        {
            from: './src/favicon',
            to: './favicon'
        },
        {
            from: './src/img',
            to: './img'
        },
        {
            from: './src/uploads',
            to: './uploads'
        }
    ]),
]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question