6

I am using webpack to config the source map. I am wondering anyone could clarify the difference between "eval" and "eval-source-map" ? I don't see the difference personally.

1 Answer 1

10

From the documentation:

eval - Each module is executed with eval() and //@ sourceURL. This is pretty fast. The main disadvantage is that it doesn't display line numbers correctly since it gets mapped to transpiled code instead of the original code (No Source Maps from Loaders).

eval-source-map - Each module is executed with eval() and a SourceMap is added as a DataUrl to the eval(). Initially it is slow, but it provides fast rebuild speed and yields real files. Line numbers are correctly mapped since it gets mapped to the original code. It yields the best quality SourceMaps for development.

Essentially eval-source-map is slower, but has more accurate mapping to the original line numbers (helpful for identifying the appropriate lines of bugs in the original source code).

Sign up to request clarification or add additional context in comments.

1 Comment

why eval-source-map has fater rebuild speed?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.