jp-coffeescript
jp-coffeescript copied to clipboard
Add option to use Babel
Also uses the new --transpile
option with babel-preset-env. Closes #11.
Note to myself: [email protected]
requires node@>=6
.
@danielbayley Thank you for your contribution. I've been testing it and I'm planning to merge it as soon as I decide how to address the following issues with [email protected]
:
-
[email protected]
doesn't transpileimport
statements. -
babel
transpilation ofimport
statements would make them scoped to a cell (see https://github.com/n-riesco/jp-babel/issues/11 ) -
if I decide to use
babel
, then the modulesbabel-*
should be listed as normal dependencies (they wouldn't be optional).
I'm also planning to enable Travis on this repository to catch compatibility issues with different Node versions.
One question, what's the purpose of this line?
@n-riesco Sure, CS will always pass import
s on, in this case to babel-preset-env…
I'm not sure what to suggest about the cell scoping, maybe a modified version of babel-plugin-transform-es2015-modules-commonjs or something? I wanted this for the Hydrogen Atom package, where I usually run-all
, so hadn't actually noticed that issue.
One question, what's the purpose of [
filename: __filename
]?
That is so that Babel will always use the config from this package (and find the env
plugin dependency), without the current working directory interfering with it. Does that make sense?
I will leave Allow edits from maintainers checked so you can tweak it however you like.
@n-riesco, has there been any decision on these issues? Coffeescript 2.0 features are very useful. I've been using this branch for several months, and the only issue I've encountered is that I need to execute require 'babel-polyfill'
before using async functions.
@zach-capalbo If I remember correctly, the main issue with this PR is that import
doesn't work.