diff --git a/documentation/docs/command.html b/documentation/docs/command.html index 085c6551..fd2016d7 100644 --- a/documentation/docs/command.html +++ b/documentation/docs/command.html @@ -192,7 +192,7 @@ useWinPathSep = path.sep is '-h', '--help', 'display this help message'] ['-i', '--interactive', 'run an interactive CoffeeScript REPL'] ['-j', '--join [FILE]', 'concatenate the source CoffeeScript before compiling'] - ['-m', '--map', 'generate source map and save as .map files'] + ['-m', '--map', 'generate source map and save as .js.map files'] ['-n', '--nodes', 'print out the parse tree that the parser produces'] [ '--nodejs [ARGS]', 'pass options directly to the "node" binary'] [ '--no-header', 'suppress the "Generated by" header'] @@ -568,7 +568,7 @@ the compiled JS version as well.

sourceCode.splice index, 1 unless opts.join silentUnlink outputPath source, base - silentUnlink outputPath source, base, '.map' + silentUnlink outputPath source, base, '.js.map' timeLog "removed #{source}" silentUnlink = (path) -> @@ -613,13 +613,13 @@ the compiled JS version as well.

Write out a JavaScript source file with the compiled code. By default, files are written out in cwd as .js files with the same name, but the output directory can be customized with --output.

-

If generatedSourceMap is provided, this will write a .map file into the +

If generatedSourceMap is provided, this will write a .js.map file into the same directory as the .js file.

writeJs = (base, sourcePath, js, jsPath, generatedSourceMap = null) ->
-  sourceMapPath = outputPath sourcePath, base, ".map"
+  sourceMapPath = outputPath sourcePath, base, ".js.map"
   jsDir  = path.dirname jsPath
   compile = ->
     if opts.compile
diff --git a/lib/coffee-script/command.js b/lib/coffee-script/command.js
index 5f32d89a..f28e5a54 100644
--- a/lib/coffee-script/command.js
+++ b/lib/coffee-script/command.js
@@ -37,7 +37,7 @@
 
   BANNER = 'Usage: coffee [options] path/to/script.coffee -- [args]\n\nIf called without options, `coffee` will run your script.';
 
-  SWITCHES = [['-b', '--bare', 'compile without a top-level function wrapper'], ['-c', '--compile', 'compile to JavaScript and save as .js files'], ['-e', '--eval', 'pass a string from the command line as input'], ['-h', '--help', 'display this help message'], ['-i', '--interactive', 'run an interactive CoffeeScript REPL'], ['-j', '--join [FILE]', 'concatenate the source CoffeeScript before compiling'], ['-m', '--map', 'generate source map and save as .map files'], ['-n', '--nodes', 'print out the parse tree that the parser produces'], ['--nodejs [ARGS]', 'pass options directly to the "node" binary'], ['--no-header', 'suppress the "Generated by" header'], ['-o', '--output [DIR]', 'set the output directory for compiled JavaScript'], ['-p', '--print', 'print out the compiled JavaScript'], ['-s', '--stdio', 'listen for and compile scripts over stdio'], ['-l', '--literate', 'treat stdio as literate style coffee-script'], ['-t', '--tokens', 'print out the tokens that the lexer/rewriter produce'], ['-v', '--version', 'display the version number'], ['-w', '--watch', 'watch scripts for changes and rerun commands']];
+  SWITCHES = [['-b', '--bare', 'compile without a top-level function wrapper'], ['-c', '--compile', 'compile to JavaScript and save as .js files'], ['-e', '--eval', 'pass a string from the command line as input'], ['-h', '--help', 'display this help message'], ['-i', '--interactive', 'run an interactive CoffeeScript REPL'], ['-j', '--join [FILE]', 'concatenate the source CoffeeScript before compiling'], ['-m', '--map', 'generate source map and save as .js.map files'], ['-n', '--nodes', 'print out the parse tree that the parser produces'], ['--nodejs [ARGS]', 'pass options directly to the "node" binary'], ['--no-header', 'suppress the "Generated by" header'], ['-o', '--output [DIR]', 'set the output directory for compiled JavaScript'], ['-p', '--print', 'print out the compiled JavaScript'], ['-s', '--stdio', 'listen for and compile scripts over stdio'], ['-l', '--literate', 'treat stdio as literate style coffee-script'], ['-t', '--tokens', 'print out the tokens that the lexer/rewriter produce'], ['-v', '--version', 'display the version number'], ['-w', '--watch', 'watch scripts for changes and rerun commands']];
 
   opts = {};
 
@@ -406,7 +406,7 @@
     sourceCode.splice(index, 1);
     if (!opts.join) {
       silentUnlink(outputPath(source, base));
-      silentUnlink(outputPath(source, base, '.map'));
+      silentUnlink(outputPath(source, base, '.js.map'));
       return timeLog("removed " + source);
     }
   };
@@ -445,7 +445,7 @@
     if (generatedSourceMap == null) {
       generatedSourceMap = null;
     }
-    sourceMapPath = outputPath(sourcePath, base, ".map");
+    sourceMapPath = outputPath(sourcePath, base, ".js.map");
     jsDir = path.dirname(jsPath);
     compile = function() {
       if (opts.compile) {
diff --git a/src/command.coffee b/src/command.coffee
index d5bae325..9ff69269 100644
--- a/src/command.coffee
+++ b/src/command.coffee
@@ -39,7 +39,7 @@ SWITCHES = [
   ['-h', '--help',            'display this help message']
   ['-i', '--interactive',     'run an interactive CoffeeScript REPL']
   ['-j', '--join [FILE]',     'concatenate the source CoffeeScript before compiling']
-  ['-m', '--map',             'generate source map and save as .map files']
+  ['-m', '--map',             'generate source map and save as .js.map files']
   ['-n', '--nodes',           'print out the parse tree that the parser produces']
   [      '--nodejs [ARGS]',   'pass options directly to the "node" binary']
   [      '--no-header',       'suppress the "Generated by" header']
@@ -309,7 +309,7 @@ removeSource = (source, base) ->
   sourceCode.splice index, 1
   unless opts.join
     silentUnlink outputPath source, base
-    silentUnlink outputPath source, base, '.map'
+    silentUnlink outputPath source, base, '.js.map'
     timeLog "removed #{source}"
 
 silentUnlink = (path) ->
@@ -334,10 +334,10 @@ outputPath = (source, base, extension=".js") ->
 # are written out in `cwd` as `.js` files with the same name, but the output
 # directory can be customized with `--output`.
 #
-# If `generatedSourceMap` is provided, this will write a `.map` file into the
+# If `generatedSourceMap` is provided, this will write a `.js.map` file into the
 # same directory as the `.js` file.
 writeJs = (base, sourcePath, js, jsPath, generatedSourceMap = null) ->
-  sourceMapPath = outputPath sourcePath, base, ".map"
+  sourceMapPath = outputPath sourcePath, base, ".js.map"
   jsDir  = path.dirname jsPath
   compile = ->
     if opts.compile