I use Google Closure to create a miniature JS / source map and cannot get the source map to connect the source to the mini script in the Sources window in Chrome.
Code taken from Google Closure Compiler Documentation
My source is this (hello.js):
// A simple function. function hello(longName) { alert('Hello, ' + longName); } hello('New User');
My compiler run command:
java -jar compiler.jar --js hello.js --js_output_file hello.min.js --create_source_map hello.min.js.map
This succeeds and creates:
Minified source (hello.min.js):
function hello(a){alert("Hello, "+a)}hello("New User");
I will add the following line to the end of hello.min.js, as recommended in this article
Everything, including the source map, is in the same directory, and the source maps are included in Chrome. The index.html page simply includes hello.min.js in the body tag.
Can anyone see what I'm doing wrong? I would really appreciate any help.
thanks
source share