Questions tagged [source-maps]

A source map allows a JavaScript debugger to map line and symbol information from a transformed (eg. minified, optimized) JavaScript file back to the original input file used for the transformation. The original file can be any kind of text file which in effect enables in-browser debugging of any language compiling to JavaScript.

JavaScript code used on websites has often gone through various stages of automated transformation (eg. minification, optimization, etc.), or have even been generated from a non-JavaScript source language targeting JavaScript as the runtime environment. These automated translations often make the final code much more difficult to understand and debug using development tools inside the browser.

Source maps solve the problem by giving the JavaScript debugger enough additional information to effectively translate locations and symbols between the processed JavaScript code and the original input file used to create it.

JavaScript source maps is a technology proposal from Google and Mozilla, and currently developed inside the Closure Compiler, WebKit, and Mozilla's DevTools.

Because source maps are not yet officially released and documented, good information about them is somewhat scarce. The following articles give an overview of the current state of source maps:

1111 questions
0
votes
0 answers

Lessc - Create Source Maps - Wrong paths

stackoverflowI am trying to create a source map with lessc so I am able to debug css in chrome. I am using the terminal. Unfortunately does the generated file contain wrong file paths. It seems it does mix up relative paths with absolute paths. My…
mogio
  • 843
  • 2
  • 7
  • 18
0
votes
0 answers

Nested selectors with less points to top most selector in sourcemap

I like nesting my selectors with less for clarity of code / organization etc. However after compiling (In this instance I am using gulp-less) and using Firefox or Chrome Developer tools to determine the line number of my selector, it will point to…
Michael Coyne
  • 164
  • 2
  • 11
0
votes
2 answers

Combine javascript files and their source maps

I am struggling with the combination of multiple javascript files and their source maps. The problem is: I use Google Closure Compiler to obfuscate two javascript files A and B, with generated source maps A.map and B.map. Since I apply different…
0
votes
1 answer

Source Map Behavior -- how to view original javascript before minification

I have built a test app with gulp-angular. I think source maps are generated automatically. After I build the app, when I look at the vendor-xxx.js, it looks like: /*! * jQuery JavaScript Library…
techguy2000
  • 4,861
  • 6
  • 32
  • 48
0
votes
1 answer

Copy map file on grunt with sass

I'm using usemin when building with grunt, and I use the following tasks on css: sass, concat, cssmin. Is it possible to have a map file in the end in order to debug the code after it's built? Thanks.
JovStern
  • 89
  • 1
  • 7
0
votes
0 answers

Sourcemaps content same as compiled output - on Windows

The problem I'm using gulp-sourcemaps to generate sourcemaps for my compiled sass. This seems to work on linux/mac computers, but not on Windows. Instead of the actual source sass, the content in the sourcemap is the same as the generated css. P.S.…
Joseph Silber
  • 214,931
  • 59
  • 362
  • 292
0
votes
1 answer

WebStorm 10.0.3 ignoring typescript breakpoints

WebStorm 10.0.3 does not pause at typescript breakpoints. This has worked for me before using WebStorm 9. Note: I know that the generated source maps are ok, because chrome dev tools manages to pause on breakpoints in .ts (typescript) files. Any…
Alon Amir
  • 4,913
  • 9
  • 47
  • 86
0
votes
0 answers

Gulp BootstrapCSS source maps

I'm trying to generate the following CSS Source Map files, through gulp.js for the BootstrapCSS library. My gulp task is as folows: bower = require 'main-bower-files' sourcemaps = require 'gulp-sourcemaps' cssmin = require…
ChrisGeo
  • 3,807
  • 13
  • 54
  • 92
0
votes
1 answer

Sourcemaps only working when clicking link from Chrome console's console.log

I'm generating inline sourcemaps for my JS using Gulp and gulp-sourcemaps and uglifying with gulp-uglify. In the Chrome developer tools, when I visit the sources tab directly and click on my uglified/sourcemapped file, Chrome doesn't try to parse…
HellaMad
  • 5,294
  • 6
  • 31
  • 53
0
votes
1 answer

Gray Background in Chrome Devtools sourcemap view

I have a bundled and minified file and a source map. I added this source map in the chrome dev tools by right clicking in the source and selecting Add Source Map.... That seems to work (although I suspect that something is getting mixed up). The…
k-nut
  • 3,447
  • 2
  • 18
  • 28
0
votes
0 answers

GWT source map in webworker

I run js compiled with GWT in webworker. Unfortunately, source maps don't work, at least in Chrome. Did anybody had this problem? What might it be? Does Chrome support source map for workers?
Konstantin Solomatov
  • 10,252
  • 8
  • 58
  • 88
0
votes
1 answer

XSSI attacks with source maps

The Source Map Proposal mentions possible XSSI attacks that make the source maps "available to attackers". Can someone explain how that is a security problem? Aren't "attackers" able to download the source maps directly?
Johannes Ewald
  • 17,665
  • 5
  • 44
  • 39
0
votes
1 answer

Live edit Sass in browser using grunt (yeoman)

Cannot figure out why scss file does not appear in browser Can you give me advice? ot should I use different tool? i do the following grunt serve in command line my gruntfile.js // Generated on 2015-02-19 using // generator-webapp 0.5.1 'use…
Sergey Bodrov
  • 23
  • 1
  • 5
0
votes
1 answer

How to use an existing source map to compile scss to css?

I have taken on an existing project from an other dev, and SCSS is being used, but the other dev used to compile the CSS files locally (not on server) using CodeKit apparently. I have a source map available, so my question is.. how can I use this…
0
votes
1 answer

Grunt Pleeease: Extend existing source map

I write Sass and use grunt-pleeease to inline @includes etc. Unfortunately pleeease inlines its source map and ignores the existing one. The source map file from sass is in the same folder as the css I pass to pleeease (main.css and main.css.map) Is…
Thomas
  • 8,426
  • 1
  • 25
  • 49