nativescript-community / nativescript-vscode-extension

A Visual Studio Code Extension for NativeScript
https://www.nativescript.org/visual-studio-code
Apache License 2.0
82 stars 32 forks source link

fix: handle webpack source maps when library is set #264

Closed rosen-vladimirov closed 4 years ago

rosen-vladimirov commented 4 years ago

In case the library path is set in webpack.config.js file, the URLs in sourceMaps are generated in a way that is not expected for our parser - currently we expect webpack:///<path>, while it becomes webpack://<library>/<path>. To handle this, add the correct sourceMapPathOverrides in case the user had not specified it already.

Add unit tests and add as devDependency @types/sinon. However, the project cannot be transpiled with the current TypeScript version (2.6) when this package is installed, so update TypeScript to latest version. Use proxyquire in the tests to mock the require of the webpack.config.js file.

Fixes https://github.com/NativeScript/nativescript-vscode-extension/issues/263