L
L
LionG2021-08-23 17:11:19
webpack
LionG, 2021-08-23 17:11:19

How to make a separate vendor for different parts of the application?

For example, I have adminka.js and app.js, now they have a common vendors.js. How to make separate vendors for them so that they don’t drag app dependencies into the admin panel and vice versa?

webpack5. Now it works like this:

optimization: {
    splitChunks: {
        cacheGroups: {
            vendor: {
                name: 'vendors',
                test: /node_modules/,
                chunks: 'all',
                enforce: true
            }
        }
    }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
inFureal, 2021-08-23
@inFureal

Tyts

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question