source-maps

Source maps in Ruby on Rails through sprockets

☆樱花仙子☆ 提交于 2019-12-02 17:30:39
I'd like to add source map support on a rails 3.2 application I am working on. As far as I know, generating source maps is not supported by Sprockets and from its github page it looks like the feature is planned for 4.0. I am working with Sprockets 2.2 and I think monkey patching is the only way to go. The module Processing under the main Sprockets module gives access to the js_compressor function which can be patched to generate source map for a single file. But, I don't know how to add this when the JS files combine. I am using Uglifier 2.4 as the compressor. The project has a mixture of

Breakpoint debugging minfied/mangled/compiled variables

非 Y 不嫁゛ 提交于 2019-12-02 16:58:50
Working on building JavaScript sourcemaps into my workflow and I've been looking for some documentation on a particular part of debugging source maps. In the picture below I'm running compressed Javascript code, but through the magic of source maps Chrome debugger was able to reconstruct the seemingly uncompressed code for me to debug: However, if you look at the local variables, someNumber and someOtherNumber are not defined. Instead, we have a and r , which are the compiled variable names for this function. This is the same for both Mozilla Firefox and Chrome. I tried looking through the

file is being assigned a //# sourceMappingURL but already has one

被刻印的时光 ゝ 提交于 2019-12-02 15:41:57
I just notice Firefox console outputs the following error for every single .js/.coffee file in my project (even the packages). -file- is being assigned a //# sourceMappingURL, but already has one Chrome's console doesn't show anything. I tried deleting all the .map files and clearing Firefox's cache but I'm still getting the errors. It's a warning (not an error) and it is a bug ( https://bugzilla.mozilla.org/show_bug.cgi?id=1020846 fixed in FF 33) This warning/error also applies to other libs (angular, backbone, etc.) I have been working on a project for over a year now, I have never seen this

Gulp Browserify SourceMaps

▼魔方 西西 提交于 2019-12-02 11:35:40
问题 I've looked at this question already and the answer doesn't work in my situation: gulp, browserify, maps? So here is what I have: gulp.task('debug-app-js', function () { console.log('DEBUG-APP-JS'); var src = './node_modules/js/app-main.js', dst = '../www/js', bundler = browserify(src, {debug:true}); return bundler.bundle() .pipe(source('app-build.js')) .pipe(gulp.dest(dst)) }); Debug is set to true, so why don't I get any sourcemaps? UPDATE: It appears to be an IE problem as the sourcemaps

Gulp Browserify SourceMaps

◇◆丶佛笑我妖孽 提交于 2019-12-02 04:51:46
I've looked at this question already and the answer doesn't work in my situation: gulp, browserify, maps? So here is what I have: gulp.task('debug-app-js', function () { console.log('DEBUG-APP-JS'); var src = './node_modules/js/app-main.js', dst = '../www/js', bundler = browserify(src, {debug:true}); return bundler.bundle() .pipe(source('app-build.js')) .pipe(gulp.dest(dst)) }); Debug is set to true, so why don't I get any sourcemaps? UPDATE: It appears to be an IE problem as the sourcemaps are appearing in Chrome and Firefox. But it's strange because I was getting sourcemaps in IE with my

Must a sourcemap have a .map extension?

谁都会走 提交于 2019-12-02 03:44:18
问题 If I create a source map, must I give it a .map extension, or could I call it .foo, as long as it has the correct headers? If someone could point to documentation on this, I would be most thankful! 回答1: It can have any extension. In the compressed/minified/original file you put a sourceMappingUrl comment or SourceMap http header that tells the interpreter where to find the source map. There's no true formal spec for source maps but this is the informal one: https://docs.google.com/document/d

Webpack use existing source map from previous build step

给你一囗甜甜゛ 提交于 2019-12-01 15:55:03
I have .ts files compiled to .js and .js.map files by my editor and am bundling the .js files using webpack. (I don't want webpack to be responsible for compiling the .ts because then the errors won't appear properly in the editor.) If I feed the compiled .js files to webpack it doesn't pick up the existing .js.map files (via //# sourceMappingURL=... in each file), and so the resulting bundle.js.map points to the .js files, but not to the original .ts files. How can I get webpack to hold onto the existing .js.map files so the resulting bundle.js.map points right back to the original .ts files?

Webpack use existing source map from previous build step

元气小坏坏 提交于 2019-12-01 14:57:25
问题 I have .ts files compiled to .js and .js.map files by my editor and am bundling the .js files using webpack. (I don't want webpack to be responsible for compiling the .ts because then the errors won't appear properly in the editor.) If I feed the compiled .js files to webpack it doesn't pick up the existing .js.map files (via //# sourceMappingURL=... in each file), and so the resulting bundle.js.map points to the .js files, but not to the original .ts files. How can I get webpack to hold onto

Source mapping in IE. //@ sourceURL

拥有回忆 提交于 2019-12-01 14:05:43
问题 In IE doesn't work //@ sourceURL. appLoader.loadScriptContent(doc, scriptData.data + "//@ sourceURL=" + scriptData.url ); In Another browsers it's OK. How can I change this code for working in IE ? 回答1: UPDATE: See the other answer, IE11 supports //# sourceURL, which is also supported by recent Firefox & Chrome. Sorry to be the bearer of bad news, but IE does not support source mapping. It's not even IE11 (at least not in the IE11 preview, anyway). It may come eventually, but for now the

How can I debug modular TypeScript with source maps?

試著忘記壹切 提交于 2019-12-01 08:47:42
I am having an impossible time trying to get TypeScript debugging working in Chrome Dev Tools. I've generated source maps for all my .ts files, and the javascript looks correct, but Chrome only loads the js file that is referenced in index.html and ignores all the modules. This kinda makes sense, because the Typescript compiler does not seem to be doing anything with my modules. If someone could explain what I'm doing wrong in the following example, that would be great. My project setup is like this: root/ src/ Company.ts User.ts app.ts index.html Company.ts module Company { export class Job {