coffee.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * `tasks/config/coffee`
  3. *
  4. * ---------------------------------------------------------------
  5. *
  6. * Compile CoffeeScript files located in `assets/js` into Javascript
  7. * and generate new `.js` files in `.tmp/public/js`.
  8. *
  9. * For more information, see:
  10. * https://sailsjs.com/anatomy/tasks/config/coffee.js
  11. *
  12. */
  13. module.exports = function(grunt) {
  14. grunt.config.set('coffee', {
  15. dev: {
  16. options: {
  17. bare: true,
  18. sourceMap: true,
  19. sourceRoot: './'
  20. },
  21. files: [{
  22. expand: true,
  23. cwd: 'assets/js/',
  24. src: ['**/*.coffee'],
  25. dest: '.tmp/public/js/',
  26. ext: '.js'
  27. }]
  28. }
  29. });
  30. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  31. // This Grunt plugin is part of the default asset pipeline in Sails,
  32. // so it's already been automatically loaded for you at this point.
  33. //
  34. // Of course, you can always remove this Grunt plugin altogether by
  35. // deleting this file. But check this out: you can also use your
  36. // _own_ custom version of this Grunt plugin.
  37. //
  38. // Here's how:
  39. //
  40. // 1. Install it as a local dependency of your Sails app:
  41. // ```
  42. // $ npm install grunt-contrib-coffee --save-dev --save-exact
  43. // ```
  44. //
  45. //
  46. // 2. Then uncomment the following code:
  47. //
  48. // ```
  49. // // Load Grunt plugin from the node_modules/ folder.
  50. // grunt.loadNpmTasks('grunt-contrib-coffee');
  51. // ```
  52. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  53. };