gogo_rulez
gogo_rulez

Reputation: 389

webpack 5 disble tree shaking for certain files

I'm creating a webpack bundler for an existing project. The project has some JS files which contain functions that are not executed from inside the file. The functions are executed from some 3rd party scripts (kind of). I need tree shaking, but these files are also removed from the final bundle. How can I setup the bundler to user tree shaking but to exclude these files?

Upvotes: 0

Views: 1338

Answers (1)

Sin
Sin

Reputation: 1100

Try disable-tree-shaking-for-chunk-plugin

Upvotes: 0

Related Questions