You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To use --transpile with globally-installed CoffeeScript, you must have babel-core installed globally:
901
+
npm install --global babel-core
902
+
And you must save options to configure Babel in one of the places it looks to find its options, relative to the file being compiled or to the current folder.
Copy file name to clipboardExpand all lines: docs/v2/index.html
+12-3Lines changed: 12 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -645,7 +645,7 @@
645
645
<sectionid="overview">
646
646
<p><strong>CoffeeScript is a little language that compiles into JavaScript.</strong> Underneath that awkward Java-esque patina, JavaScript has always had a gorgeous heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.</p>
647
647
<p>The golden rule of CoffeeScript is: <em>“It’s just JavaScript.”</em> The code compiles one-to-one into the equivalent JS, and there is no interpretation at runtime. You can use any existing JavaScript library seamlessly from CoffeeScript (and vice-versa). The compiled output is readable, pretty-printed, and tends to run as fast or faster than the equivalent handwritten JavaScript.</p>
<blockquoteclass="uneditable-code-block"><pre><codeclass="language-bash"><spanclass="comment"># Install locally for a project:</span>
650
650
npm install --save-dev coffeescript
651
651
@@ -4820,7 +4820,7 @@ <h2>Web Chat (IRC)</h2>
4820
4820
</section>
4821
4821
<sectionid="annotated-source">
4822
4822
<h2>Annotated Source</h2>
4823
-
<p>You can browse the CoffeeScript 2.0.0 source in readable, annotated form <ahref="annotated-source/">here</a>. You can also jump directly to a particular source file:</p>
4823
+
<p>You can browse the CoffeeScript 2.0.1 source in readable, annotated form <ahref="annotated-source/">here</a>. You can also jump directly to a particular source file:</p>
<li><code>babel-core</code> is no longer listed in <code>package.json</code>, even as an <code>optionalDependency</code>, to avoid it being automatically installed for most users. If you wish to use <code>--transpile</code>, simply install <code>babel-core</code> manually. See <ahref="#transpilation">Transpilation</a>.</li>
5457
+
<li><code>--transpile</code> now relies on Babel to find its options, i.e. the <code>.babelrc</code> file in the path of the file(s) being compiled. (Previously the CoffeeScript compiler was duplicating this logic, so nothing has changed from a user’s perspective.) This provides automatic support for additional ways to pass options to Babel in future versions, such as the <code>.babelrc.js</code> file coming in Babel 7.</li>
5458
+
<li>Backticked expressions in a class body, outside any class methods, are now output in the JavaScript class body itself. This allows for passing through experimental JavaScript syntax like the <ahref="https://github.com/tc39/proposal-class-fields">class fields proposal</a>, assuming your <ahref="https://babeljs.io/docs/plugins/transform-class-properties/">transpiler supports it</a>.</li>
<li>Added <code>--transpile</code> flag or <code>transpile</code> Node API option to tell the CoffeeScript compiler to pipe its output through Babel before saving or returning it; see <ahref="#transpilation">Transpilation</a>. Also changed the <code>-t</code> short flag to refer to <code>--transpile</code> instead of <code>--tokens</code>.</li>
*`babel-core` is no longer listed in `package.json`, even as an `optionalDependency`, to avoid it being automatically installed for most users. If you wish to use `--transpile`, simply install `babel-core` manually. See [Transpilation](#transpilation).
8
+
*`--transpile` now relies on Babel to find its options, i.e. the `.babelrc` file in the path of the file(s) being compiled. (Previously the CoffeeScript compiler was duplicating this logic, so nothing has changed from a user’s perspective.) This provides automatic support for additional ways to pass options to Babel in future versions, such as the `.babelrc.js` file coming in Babel 7.
9
+
* Backticked expressions in a class body, outside any class methods, are now output in the JavaScript class body itself. This allows for passing through experimental JavaScript syntax like the [class fields proposal](https://github.com/tc39/proposal-class-fields), assuming your [transpiler supports it](https://babeljs.io/docs/plugins/transform-class-properties/).
* Added `--transpile` flag or `transpile` Node API option to tell the CoffeeScript compiler to pipe its output through Babel before saving or returning it; see [Transpilation](#transpilation). Also changed the `-t` short flag to refer to `--transpile` instead of `--tokens`.
0 commit comments