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
1 answer

Sourcemap for Appium, using Visual Studio Code as debugger?

I am setting up a debugging environment for Appium, which is a nodejs application with a gulpfile. I am able to run gulp transpile which generates .js files in build/lib. Now when it comes to setting breakpoints, I need to set breakpoints in…
atlantis
  • 817
  • 1
  • 10
  • 16
0
votes
0 answers

Compiling LESS with mapping. How to set relative path for sources?

I have some problems with creating a proper .map file. I compile by this way: lessc --source-map=styles.map styles.less styles.css The problem is that the path to the sources files is a full local path. It looks like this (quote from the beginning…
Shimon S
  • 4,048
  • 2
  • 29
  • 34
0
votes
1 answer

Webpack with chunkFileName and source-maps

A project I'm working on is using the code splitting facility of Webpack. I'm having trouble actually getting source maps to work with it. I've used source maps successfully on other projects that don't use code splitting and wonder if this is the…
Simon Lomax
  • 8,714
  • 8
  • 42
  • 75
0
votes
1 answer

CSS Sourcemaps not loaded

So I have the following task: gulp.task('sass', function () { gulp.src(['./angular/app/**/*.s+(a|c)ss']) .pipe($.concat('app.css')) .pipe($.sourcemaps.init()) .pipe($.sass({ includePaths: ['./angular/app/global']…
Kiwi
  • 2,713
  • 7
  • 44
  • 82
0
votes
0 answers

Debug es2015/jsx when transpiled in browser

Using the above technique (in browser transpilation with babel), is there a way to get source maps and errors working? Errors that I would expect to appear in the console seem to be swallowed.
Tom
  • 7,994
  • 8
  • 45
  • 62
0
votes
1 answer

grunt-contrib-less: compilation on watch task removes sourcemap link

Here's my less task config: less: { development: { options: { compress: false, sourceMap: true, yuicompress: true, sourceMapFilename: 'export/style/app.css.map', sourceMapURL:…
valerio0999
  • 11,458
  • 7
  • 28
  • 56
0
votes
1 answer

How to generate a 'single' sourcemap for entire project using babel 6?

Is it possible to generate a single sourcemap for an entire project using babel? Because each sourcemap foe each file generates an ugly project structure.
kalpa
  • 657
  • 2
  • 11
  • 22
0
votes
1 answer

Usage of gulp-sourcemaps with angular (IIFE pattern). Do I understand sourcemaps correctly?

To begin, this would be the first time I attempt to work with exporting source maps through my gulp builds. I am using angular 1.4.x and we have adopted the following pattern :: (function() { 'use strict'; var thing = (function() { …
beauXjames
  • 8,222
  • 3
  • 49
  • 66
0
votes
1 answer

Sourcemap between compiled, minified and concatenated css file and sass files

I have following task which compiles *.scss files to scc, minifies them and concatenates to one css file. gulp.task("scss-to-css", ["clean-css"], function () { return gulp.src(pathToScssFiles) .pipe(sass()) .pipe(minifyCss({})) …
rnofenko
  • 9,198
  • 2
  • 46
  • 56
0
votes
1 answer

Error generating TypeScript code coverage reports with remap-istanbul + browserify + source maps

I'm getting the following error: Error: Could not find file: "..\..\..\..\source\node_modules\browserify\node_modules\browser-pack\_prelude.js" at readFile…
Remo H. Jansen
  • 23,172
  • 11
  • 70
  • 93
0
votes
1 answer

How Gulp + sourcemaps work for debugging

So I just got set up with Gulp yesterday and after a rocky start I'm well on my way to automating build processes, but I decided to try and do something a teensy bit trickier and suddenly hit another wall. My desired output is to have a minified…
stevendesu
  • 15,753
  • 22
  • 105
  • 182
0
votes
1 answer

How to pass file name/options to Grunt minifyify

I'm using the minifyify plugin as recommended by this answer but I can't seem to find any way to pass flags/options to it when used with Grunt. Here is the relevant part of my Gruntfile: grunt.initConfig({ pkg:…
rink.attendant.6
  • 44,500
  • 61
  • 101
  • 156
0
votes
1 answer

Chrome workspaces not working with Source Maps and Javascript

I've recently started working in a Browserify built Javascript app that uses source maps with ReactJs and I haven't been able to get Chrome's Workspace to work. I'm following the same steps I used in my previous AngularJs app that wasn't using…
Ryan Vice
  • 2,133
  • 3
  • 23
  • 33
0
votes
1 answer

Code maps with Browserify in Chrome

I'm just trying out browserify, and I can't get it working with source maps. In package.json I have: "build": "browserify --debug myApp.js -o bundle.js" I run it with npm run build, and it generates a bundle.js file that has at the bottom a line…
thund
  • 1,842
  • 2
  • 21
  • 31
0
votes
2 answers

Rogue sourceMap to prevent Chrome DevTools debugging

Is it possible to purposefully create a bad sourcemap for a javascript file to make it harder to see the pretty source code or debug through it to people outside the development team? Do you know any tools to do that? Where can I find the details of…