One of the easiest performance wins you can gain for your website is to combine and compress your JavaScript and CSS files. But what happens when you need to debug the code within those compressed files? It can be a nightmare. Fear not however, there is a solution on the horizon and it goes by the name of source maps. A source map provides a way of mapping code within a compressed file back to it’
jQuery 1.9 がリリースされました。1.9 の新機能の中ではあまり注目されていませんが、ソースマップに対応したのが地味に便利そうです。 というのも、圧縮版の jquery.min.js を使っていると 何か問題が起きたときにスタックトレースを眺めても jQuery の部分が意味不明 デバッガーで jQuery のソースにステップインしても意味不明 といった理由で、開発中には非圧縮の jquery.js を使うことが多かったわけです。 それが、1.9 からはソースマップに対応したので圧縮版のままでのデバッグが簡単になってます。 超簡単な使い方 ソースマップに対応したブラウザーは現時点では Google Chrome のみなので、Google Chrome の手順を説明します。 (Firefox はソースマップへの対応を計画中らしい) 事前準備を忘れずに Google Chrome で
Compiling to JavaScript, and Debugging with Source Maps Update 2013/05/29: I have updated the article to reflect recent changes in the source map specification where the //@ syntax for linking a source map to a script has been deprecated in favor of //# due to problems with Internet Explorer. This is a tutorial on how to write a compiler which generates JavaScript as its target language, and maint
タイトルは釣りです。まだDartは対応してません。 Introduction to JavaScript Source Maps - HTML5 Rocks 圧縮後のJavaScriptやコンパイル後のCoffeeScriptでも、ブラウザ上で元のソースを参照できる新技術「Source Maps」登場 - Publickey Source MapというJavaScriptのデバッグのための仕様が提案されており、WebKitにこの機能が実装されたようです。これは、実行されるJSとそのオリジナルのソースコード*1をマッピングするデータを用意しておき、Chrome Inspectorなどのデバッガでオリジナルのソースコードを参照できるようにする仕組みです。 この仕組があれば、minifyされたJSはもちろんのこと、CoffeeScriptやDartのような別言語からJSにコンパイルする言語のデバ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く