Edit Page

tasks/config/coffee.js

This file configures a Grunt task called "coffee".

By default, this compiles CoffeeScript files located in assets/js/ into JavaScript, then generates new .js files in .tmp/public/js/.

But I'm not using CoffeeScript...

No problem!

If you aren't using any kind of pre-processing for your client-side JavaScript, then just ignore this file.

If you want to use a different pre-processor like TypeScript or Babel, and you want Sails to process your client-side JavaScript assets automatically as you work, then you're in luck. In most cases, this is as easy as installing the appropriate Grunt plugin as a dependency of your Sails app, and then configuring it to output compiled JavaScript to the same path as in this default task.

Here are a couple of popular examples:

Usage

For additional usage documentation, see grunt-contrib-coffee.

Want to see for yourself?

An example of this file can be found in our sample app repo, here.

Check out the official Sails VS Code extension

Documentation

App Structure


Sails logo

Anatomy of a Sails App

AltStyle によって変換されたページ (->オリジナル) /