SurviveJS - Webpack: From apprentice to master by Juho Vepsäläinen

SurviveJS - Webpack: From apprentice to master by Juho Vepsäläinen

Author:Juho Vepsäläinen [Vepsäläinen, Juho]
Language: eng
Format: azw3
Publisher: 978-952-68688
Published: 2017-03-27T04:00:00+00:00


19.2 Tree Shaking on Package Level

The same idea works with dependencies that use the ES6 module definition. Given the related packaging standards are still emerging, you have to be careful when consuming such packages. Webpack tries to resolve package.json module field for this reason.

For tools like webpack to allow tree shake npm packages, you should generate a build that has transpiled everything else except the ES6 module definitions and then point to it through package.json module field. In Babel terms, you have to let webpack to manage ES6 modules by setting "modules": false.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.