andrey-skl / ng-annotate-loader

Webpack loader to annotate angular applications
MIT License
120 stars 28 forks source link

Fix sourcemaps issues (again) #41

Closed timofei-iatsenko closed 7 years ago

timofei-iatsenko commented 7 years ago

Options objects passed by reference to loader, and first write to map property, share this value in next invocations. It cause incorrect filename in sourcemaps in subsequent calls (because map === undefined check is not passed).

Look at documentation for loaderUtils.getOptions:

The returned options object is read-only. It may be re-used across multiple invocations. If you pass it on to another library, make sure to make a deep copy of it

So, this MR about it. Otherwise sourcemaps of annotated files are skipped in final bundle.

andrey-skl commented 7 years ago

Okay, looks good. Thanks!

timofei-iatsenko commented 7 years ago

Have you bumped version on npm?

andrey-skl commented 7 years ago

Okay, 0.6.1 is just published