Adds plugin support for CoffeeScript 2.x. #745
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Additions
All right, here's a plugin to add CoffeeScript support to Gatsby.
A few caveats: first, CoffeeScript + React is currently a troubled combination. This plugin relies upon deprecated modules that may someday prove to be dysfunctional or otherwise deficient.
Second, the installed version of CoffeeScript is next. This is not optional - named exports are required for page queries to work properly.
And finally, you will need to manually edit your
coffee-loader
installation and installcoffeescript
separately in your project directory to ensure that CoffeeScript@next is being loaded. The very first line of source in the former'sindex.js
should be the following: note the lack of dash.When
coffee-loader
starts to support CoffeeScript 2.x this hack will no longer be necessary.That's it. Fairly simple module. Add
gatsby-plugin-coffeescript
to yourgatsby-config.js
file and go to town.