James W.
James W.

Reputation: 3055

unpack webpack javascript libraries

Webpack is using terser to minify js files

  1. Does webpack always minifies the libraries using their sources ? (even if a minified version exists in the library )
  2. Is there a way to unpack & extract the minified libraries ? this answer is outdates
  3. does webpack has a flag to save minified versions aside ?

Upvotes: 0

Views: 1467

Answers (1)

IVO GELOV
IVO GELOV

Reputation: 14259

  1. Webpack first performs tree shaking and combines the libraries into a bundle before minifying this bundle
  2. Minification (just like compilation from high-level language into machine code) is irreversible transformation
  3. If you want to have both minified (for production) and unminified (for debugging) verions of the bundle - you will have to run Webpack twice, with 2 different config files

Upvotes: 1

Related Questions