Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Higher quality source maps are very slow #126

Closed
koggdal opened this issue Sep 2, 2019 · 4 comments
Closed

Higher quality source maps are very slow #126

koggdal opened this issue Sep 2, 2019 · 4 comments

Comments

@koggdal
Copy link
Contributor

koggdal commented Sep 2, 2019

  • Operating System: macOS 10.14.6
  • Node Version: 10.15.3
  • NPM Version: 6.4.1
  • webpack Version: 4.39.3
  • terser-webpack-plugin Version: 1.4.1

After upgrading our project to Webpack 4.39.0 (and above) builds got a lot slower. It's a fairly big Webpack setup, building several products in the same Webpack command (several configs specified). A build used to take around 4 minutes, but after upgrading it took around 15 minutes. After some investigation, it turns out it's because of the change made in #109. It's a bit unclear to me what the behavior change is with changing terserOptions.sourceMap = { content: inputSourceMap }; to terserOptions.sourceMap = true, as the docs for terser don't really document what happens with true.

Was the build quick before only because of broken source maps and the new build time is the normal time it should be taking? Or is there another bug to be fixed to generate high quality source maps without making the build take three times as long as before?

Expected Behavior

Builds to not be this much slower when upgrading terser-webpack-plugin from 1.3.0 to 1.4.0 (and later).

Actual Behavior

Builds take at least three times as long.

How Do We Reproduce?

Our app is closed source, so unfortunately I can't share that. I tried reproducing it with https://github.com/adaniliuk/webpack-sourcemap-testing but it doesn't seem to show much there, probably because the project is so small and builds extremely fast either way. Let me know if I should find some more details or test something out!

@alexander-akait
Copy link
Member

Please open issue in webpack, we use webpack api

@koggdal
Copy link
Contributor Author

koggdal commented Sep 2, 2019

As I'm not that familiar with how these things work, I don't have enough knowledge right now to do that. The issue I'm seeing started happening with the change in #109. That is using the value true for terserOptions.sourceMap, which is not really a documented value (only false and an object is documented, at least the effect of the value true is not documented). So, as the switch to using this new undocumented value caused the problems I'm seeing, some more guidance from you would be great! :)

Also, in what way is this using the Webpack API? What I'm commenting on is a call you're making to terser.

@alexander-akait
Copy link
Member

alexander-akait commented Sep 2, 2019

@koggdal

Also, in what way is this using the Webpack API?

New source map generation based on webpack-source package. We use information provided by webpack.

Also your perf regression is expected, before you have broken source maps, now they are valid and contains unbroken information so you require more time for generation source maps. Unfortunately we can not do anything on the side of the plugin.

@koggdal
Copy link
Contributor Author

koggdal commented Sep 2, 2019

Okay, thank you!

@koggdal koggdal closed this as completed Sep 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants