https://github.com/giansalex/aspnet-bundling-sourcemap
Asp.Net Bundling with source map (Sample)
https://github.com/giansalex/aspnet-bundling-sourcemap
aspnet-mvc bundling
Last synced: 6 months ago
JSON representation
Asp.Net Bundling with source map (Sample)
- Host: GitHub
- URL: https://github.com/giansalex/aspnet-bundling-sourcemap
- Owner: giansalex
- Created: 2018-05-08T23:15:23.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-06-02T03:43:10.000Z (over 7 years ago)
- Last Synced: 2025-02-13T05:44:11.393Z (8 months ago)
- Topics: aspnet-mvc, bundling
- Language: JavaScript
- Homepage:
- Size: 524 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bundling SourceMaps
Asp.Net Bundling with source map for Correct Error Logging.## Packages
- [AspNetBundling](https://github.com/benmccallum/AspNetBundling)
- [stacktrace.js](https://github.com/stacktracejs/stacktrace.js/)## Steps
In BundleConfig.cs use `ScriptWithSourceMapBundle`:
```csharpbundles.Add(new ScriptWithSourceMapBundle("~/Scripts/app").Include(
"~/Scripts/log.js",
"~/Scripts/app.js"));```
In js error logging:
```jswindow.onerror = function (msg, url, line, col, error) {
var callback = function(stackframes) {
// proccess stackFrames:
// [{columnNumber: 5, fileName: "https://domain.com/Scripts/app.js", functionName:"action", lineNumber:9}]
console.log(stackframes);
};
StackTrace.fromError(error).then(callback);return true;
};```
### Result
Correct row and column position from original source code.